From fde64e0b3d2fa3624c87913a668579da91be0ce6 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Thu, 5 Apr 2012 22:21:28 +0200
Subject: [PATCH] forgot to add these
---
backup.rails2.3/Gemfile.rails2.3 | 65 ++
backup.rails2.3/Gemfile.rails3 | 39 ++
backup.rails2.3/app/apis/todo_api.rb | 22 +
backup.rails2.3/application_helper.rb.rails2 | 301 +++++++++
backup.rails2.3/database.yml.rails2 | 37 ++
backup.rails2.3/development.rb.rails2 | 19 +
backup.rails2.3/environment.rb.rails2 | 119 ++++
backup.rails2.3/lib/assets/.gitkeep | 0
.../lib/authenticated_test_helper.rb | 113 ++++
backup.rails2.3/lib/login_system.rb | 222 +++++++
backup.rails2.3/lib/name_part_finder.rb | 5 +
backup.rails2.3/lib/tagging_extensions.rb | 200 ++++++
backup.rails2.3/lib/tasks/.gitkeep | 0
.../lib/tasks/cucumber-tracks.rake | 38 ++
backup.rails2.3/lib/tasks/cucumber.rake | 53 ++
backup.rails2.3/lib/tasks/database.rake | 27 +
.../lib/tasks/extract_fixtures.rake | 17 +
backup.rails2.3/lib/tasks/gems.rake | 34 ++
.../lib/tasks/load_exported_fixtures.rake | 8 +
.../lib/tasks/query_trace_toggle.rake | 50 ++
backup.rails2.3/lib/tasks/reset_password.rake | 23 +
backup.rails2.3/lib/tasks/rspec.rake | 144 +++++
backup.rails2.3/lib/tasks/setup_tracks.rake | 15 +
.../lib/tasks/upgrade_sqlite_db.rake | 40 ++
backup.rails2.3/lib/tracks/config.rb | 27 +
backup.rails2.3/lib/tracks/source_view.rb | 68 +++
backup.rails2.3/lib/tracks/todo_list.rb | 59 ++
backup.rails2.3/mongrel_workaround.rb | 107 ++++
backup.rails2.3/new_rails_defaults.rb | 21 +
.../plugins/extra_validations/init.rb | 2 +
.../lib/extra_validations.rb | 29 +
.../plugins/open_id_authentication/CHANGELOG | 35 ++
.../plugins/open_id_authentication/README | 231 +++++++
.../plugins/open_id_authentication/Rakefile | 22 +
...open_id_authentication_tables_generator.rb | 11 +
.../templates/migration.rb | 20 +
.../templates/migration.rb | 26 +
...open_id_authentication_tables_generator.rb | 11 +
.../plugins/open_id_authentication/init.rb | 18 +
.../lib/open_id_authentication.rb | 240 ++++++++
.../lib/open_id_authentication/association.rb | 9 +
.../lib/open_id_authentication/db_store.rb | 55 ++
.../lib/open_id_authentication/nonce.rb | 5 +
.../lib/open_id_authentication/request.rb | 23 +
.../open_id_authentication/timeout_fixes.rb | 20 +
.../tasks/open_id_authentication_tasks.rake | 30 +
.../test/normalize_test.rb | 32 +
.../test/open_id_authentication_test.rb | 46 ++
.../test/status_test.rb | 14 +
.../test/test_helper.rb | 17 +
.../plugins/resource_feeder/README | 7 +
.../plugins/resource_feeder/Rakefile | 22 +
.../plugins/resource_feeder/init.rb | 2 +
.../resource_feeder/lib/resource_feeder.rb | 2 +
.../lib/resource_feeder/atom.rb | 67 ++
.../lib/resource_feeder/common.rb | 24 +
.../lib/resource_feeder/rss.rb | 68 +++
.../resource_feeder/test/atom_feed_test.rb | 85 +++
.../resource_feeder/test/rss_feed_test.rb | 86 +++
.../resource_feeder/test/test_helper.rb | 64 ++
.../plugins/simple_ldap_authenticator/README | 5 +
.../simple_ldap_authenticator/Rakefile | 22 +
.../plugins/simple_ldap_authenticator/init.rb | 2 +
.../simple_ldap_authenticator/install.rb | 1 +
.../lib/simple_ldap_authenticator.rb | 127 ++++
.../simple_ldap_authenticator_tasks.rake | 4 +
.../test/simple_ldap_authenticator_test.rb | 8 +
.../plugins/skinny_spec/.gitignore | 2 +
.../plugins/skinny_spec/README.rdoc | 270 ++++++++
backup.rails2.3/plugins/skinny_spec/Rakefile | 11 +
.../additional/helper_overrides.txt | 58 ++
.../skinny_scaffold_generator.rb | 102 ++++
.../skinny_scaffold/templates/controller.rb | 105 ++++
.../templates/controller_spec.rb | 93 +++
.../skinny_scaffold/templates/form.html.erb | 25 +
.../skinny_scaffold/templates/form.html.haml | 18 +
.../templates/form.html_spec.rb | 40 ++
.../skinny_scaffold/templates/helper.rb | 2 +
.../skinny_scaffold/templates/helper_spec.rb | 5 +
.../skinny_scaffold/templates/index.html.erb | 31 +
.../skinny_scaffold/templates/index.html.haml | 23 +
.../templates/index.html_spec.rb | 15 +
.../templates/index_partial.html.erb | 12 +
.../templates/index_partial.html.haml | 11 +
.../templates/index_partial.html_spec.rb | 31 +
.../skinny_scaffold/templates/migration.rb | 14 +
.../skinny_scaffold/templates/model.rb | 2 +
.../skinny_scaffold/templates/model_spec.rb | 25 +
.../skinny_scaffold/templates/show.html.erb | 15 +
.../skinny_scaffold/templates/show.html.haml | 13 +
.../templates/show.html_spec.rb | 31 +
.../lib/lucky_sneaks/common_spec_helpers.rb | 83 +++
.../controller_request_helpers.rb | 67 ++
.../lucky_sneaks/controller_spec_helpers.rb | 571 +++++++++++++++++
.../lucky_sneaks/controller_stub_helpers.rb | 238 ++++++++
.../lib/lucky_sneaks/model_spec_helpers.rb | 496 +++++++++++++++
.../lib/lucky_sneaks/view_spec_helpers.rb | 577 ++++++++++++++++++
.../lib/lucky_sneaks/view_stub_helpers.rb | 15 +
.../plugins/skinny_spec/lib/skinny_spec.rb | 26 +
backup.rails2.3/plugins/swf_fu/CHANGELOG.rdoc | 46 ++
.../plugins/swf_fu/FLASH_OBJECT.rdoc | 31 +
backup.rails2.3/plugins/swf_fu/LICENSE | 29 +
backup.rails2.3/plugins/swf_fu/README.rdoc | 92 +++
backup.rails2.3/plugins/swf_fu/Rakefile | 22 +
.../swf_fu/assets/javascripts/swfobject.js | 4 +
.../swf_fu/assets/swfs/expressInstall.swf | Bin 0 -> 727 bytes
backup.rails2.3/plugins/swf_fu/init.rb | 14 +
backup.rails2.3/plugins/swf_fu/install.rb | 24 +
.../helpers/asset_tag_helper/swf_asset.rb | 61 ++
.../lib/action_view/helpers/swf_fu_helper.rb | 197 ++++++
.../plugins/swf_fu/test/results.rb | 42 ++
.../plugins/swf_fu/test/swf_fu_test.rb | 159 +++++
.../plugins/swf_fu/test/test_helper.rb | 20 +
backup.rails2.3/plugins/swf_fu/uninstall.rb | 6 +
backup.rails2.3/plugins/translate/MIT-LICENSE | 20 +
backup.rails2.3/plugins/translate/README | 63 ++
backup.rails2.3/plugins/translate/Rakefile | 11 +
backup.rails2.3/plugins/translate/init.rb | 8 +
.../plugins/translate/lib/translate.rb | 8 +
.../plugins/translate/lib/translate/file.rb | 35 ++
.../plugins/translate/lib/translate/keys.rb | 152 +++++
.../plugins/translate/lib/translate/log.rb | 35 ++
.../plugins/translate/lib/translate/routes.rb | 11 +
.../translate/lib/translate/storage.rb | 28 +
.../translate/lib/translate_controller.rb | 165 +++++
.../plugins/translate/lib/translate_helper.rb | 45 ++
.../controllers/translate_controller_spec.rb | 129 ++++
.../plugins/translate/spec/file_spec.rb | 54 ++
.../files/translate/app/models/article.rb | 12 +
.../files/translate/app/views/category.erb | 1 +
.../files/translate/app/views/category.html | 1 +
.../translate/app/views/category.html.erb | 1 +
.../files/translate/app/views/category.rhtml | 5 +
.../public/javascripts/application.js | 1 +
.../plugins/translate/spec/keys_spec.rb | 179 ++++++
.../plugins/translate/spec/log_spec.rb | 47 ++
.../plugins/translate/spec/spec_helper.rb | 11 +
.../plugins/translate/spec/storage_spec.rb | 33 +
.../plugins/translate/tasks/translate.rake | 178 ++++++
.../translate/views/layouts/translate.rhtml | 359 +++++++++++
.../views/translate/_pagination.rhtml | 24 +
.../translate/views/translate/index.rhtml | 114 ++++
backup.rails2.3/production.rb.rails2 | 17 +
backup.rails2.3/routes.rb.rails2 | 113 ++++
config/initializers/tracks.rb | 45 ++
145 files changed, 9044 insertions(+)
create mode 100644 backup.rails2.3/Gemfile.rails2.3
create mode 100644 backup.rails2.3/Gemfile.rails3
create mode 100644 backup.rails2.3/app/apis/todo_api.rb
create mode 100644 backup.rails2.3/application_helper.rb.rails2
create mode 100644 backup.rails2.3/database.yml.rails2
create mode 100644 backup.rails2.3/development.rb.rails2
create mode 100644 backup.rails2.3/environment.rb.rails2
create mode 100644 backup.rails2.3/lib/assets/.gitkeep
create mode 100644 backup.rails2.3/lib/authenticated_test_helper.rb
create mode 100644 backup.rails2.3/lib/login_system.rb
create mode 100644 backup.rails2.3/lib/name_part_finder.rb
create mode 100644 backup.rails2.3/lib/tagging_extensions.rb
create mode 100644 backup.rails2.3/lib/tasks/.gitkeep
create mode 100644 backup.rails2.3/lib/tasks/cucumber-tracks.rake
create mode 100644 backup.rails2.3/lib/tasks/cucumber.rake
create mode 100644 backup.rails2.3/lib/tasks/database.rake
create mode 100644 backup.rails2.3/lib/tasks/extract_fixtures.rake
create mode 100644 backup.rails2.3/lib/tasks/gems.rake
create mode 100644 backup.rails2.3/lib/tasks/load_exported_fixtures.rake
create mode 100644 backup.rails2.3/lib/tasks/query_trace_toggle.rake
create mode 100644 backup.rails2.3/lib/tasks/reset_password.rake
create mode 100644 backup.rails2.3/lib/tasks/rspec.rake
create mode 100644 backup.rails2.3/lib/tasks/setup_tracks.rake
create mode 100644 backup.rails2.3/lib/tasks/upgrade_sqlite_db.rake
create mode 100644 backup.rails2.3/lib/tracks/config.rb
create mode 100644 backup.rails2.3/lib/tracks/source_view.rb
create mode 100644 backup.rails2.3/lib/tracks/todo_list.rb
create mode 100644 backup.rails2.3/mongrel_workaround.rb
create mode 100644 backup.rails2.3/new_rails_defaults.rb
create mode 100644 backup.rails2.3/plugins/extra_validations/init.rb
create mode 100644 backup.rails2.3/plugins/extra_validations/lib/extra_validations.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/CHANGELOG
create mode 100644 backup.rails2.3/plugins/open_id_authentication/README
create mode 100644 backup.rails2.3/plugins/open_id_authentication/Rakefile
create mode 100644 backup.rails2.3/plugins/open_id_authentication/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/generators/open_id_authentication_tables/templates/migration.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/generators/upgrade_open_id_authentication_tables/templates/migration.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/generators/upgrade_open_id_authentication_tables/upgrade_open_id_authentication_tables_generator.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/init.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/lib/open_id_authentication.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/lib/open_id_authentication/association.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/lib/open_id_authentication/db_store.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/lib/open_id_authentication/nonce.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/lib/open_id_authentication/request.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/tasks/open_id_authentication_tasks.rake
create mode 100644 backup.rails2.3/plugins/open_id_authentication/test/normalize_test.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/test/open_id_authentication_test.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/test/status_test.rb
create mode 100644 backup.rails2.3/plugins/open_id_authentication/test/test_helper.rb
create mode 100644 backup.rails2.3/plugins/resource_feeder/README
create mode 100644 backup.rails2.3/plugins/resource_feeder/Rakefile
create mode 100644 backup.rails2.3/plugins/resource_feeder/init.rb
create mode 100644 backup.rails2.3/plugins/resource_feeder/lib/resource_feeder.rb
create mode 100644 backup.rails2.3/plugins/resource_feeder/lib/resource_feeder/atom.rb
create mode 100644 backup.rails2.3/plugins/resource_feeder/lib/resource_feeder/common.rb
create mode 100644 backup.rails2.3/plugins/resource_feeder/lib/resource_feeder/rss.rb
create mode 100644 backup.rails2.3/plugins/resource_feeder/test/atom_feed_test.rb
create mode 100644 backup.rails2.3/plugins/resource_feeder/test/rss_feed_test.rb
create mode 100644 backup.rails2.3/plugins/resource_feeder/test/test_helper.rb
create mode 100644 backup.rails2.3/plugins/simple_ldap_authenticator/README
create mode 100644 backup.rails2.3/plugins/simple_ldap_authenticator/Rakefile
create mode 100644 backup.rails2.3/plugins/simple_ldap_authenticator/init.rb
create mode 100644 backup.rails2.3/plugins/simple_ldap_authenticator/install.rb
create mode 100644 backup.rails2.3/plugins/simple_ldap_authenticator/lib/simple_ldap_authenticator.rb
create mode 100644 backup.rails2.3/plugins/simple_ldap_authenticator/tasks/simple_ldap_authenticator_tasks.rake
create mode 100644 backup.rails2.3/plugins/simple_ldap_authenticator/test/simple_ldap_authenticator_test.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/.gitignore
create mode 100644 backup.rails2.3/plugins/skinny_spec/README.rdoc
create mode 100644 backup.rails2.3/plugins/skinny_spec/Rakefile
create mode 100644 backup.rails2.3/plugins/skinny_spec/additional/helper_overrides.txt
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/skinny_scaffold_generator.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/controller.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/controller_spec.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/form.html.erb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/form.html.haml
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/form.html_spec.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/helper.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/helper_spec.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/index.html.erb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/index.html.haml
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/index.html_spec.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/index_partial.html.erb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/index_partial.html.haml
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/index_partial.html_spec.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/migration.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/model.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/model_spec.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/show.html.erb
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/show.html.haml
create mode 100644 backup.rails2.3/plugins/skinny_spec/generators/skinny_scaffold/templates/show.html_spec.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/lib/lucky_sneaks/common_spec_helpers.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/lib/lucky_sneaks/controller_request_helpers.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/lib/lucky_sneaks/controller_spec_helpers.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/lib/lucky_sneaks/controller_stub_helpers.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/lib/lucky_sneaks/model_spec_helpers.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/lib/lucky_sneaks/view_spec_helpers.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/lib/lucky_sneaks/view_stub_helpers.rb
create mode 100644 backup.rails2.3/plugins/skinny_spec/lib/skinny_spec.rb
create mode 100644 backup.rails2.3/plugins/swf_fu/CHANGELOG.rdoc
create mode 100644 backup.rails2.3/plugins/swf_fu/FLASH_OBJECT.rdoc
create mode 100644 backup.rails2.3/plugins/swf_fu/LICENSE
create mode 100644 backup.rails2.3/plugins/swf_fu/README.rdoc
create mode 100644 backup.rails2.3/plugins/swf_fu/Rakefile
create mode 100644 backup.rails2.3/plugins/swf_fu/assets/javascripts/swfobject.js
create mode 100755 backup.rails2.3/plugins/swf_fu/assets/swfs/expressInstall.swf
create mode 100644 backup.rails2.3/plugins/swf_fu/init.rb
create mode 100644 backup.rails2.3/plugins/swf_fu/install.rb
create mode 100644 backup.rails2.3/plugins/swf_fu/lib/action_view/helpers/asset_tag_helper/swf_asset.rb
create mode 100644 backup.rails2.3/plugins/swf_fu/lib/action_view/helpers/swf_fu_helper.rb
create mode 100644 backup.rails2.3/plugins/swf_fu/test/results.rb
create mode 100644 backup.rails2.3/plugins/swf_fu/test/swf_fu_test.rb
create mode 100644 backup.rails2.3/plugins/swf_fu/test/test_helper.rb
create mode 100644 backup.rails2.3/plugins/swf_fu/uninstall.rb
create mode 100644 backup.rails2.3/plugins/translate/MIT-LICENSE
create mode 100644 backup.rails2.3/plugins/translate/README
create mode 100644 backup.rails2.3/plugins/translate/Rakefile
create mode 100644 backup.rails2.3/plugins/translate/init.rb
create mode 100644 backup.rails2.3/plugins/translate/lib/translate.rb
create mode 100644 backup.rails2.3/plugins/translate/lib/translate/file.rb
create mode 100644 backup.rails2.3/plugins/translate/lib/translate/keys.rb
create mode 100644 backup.rails2.3/plugins/translate/lib/translate/log.rb
create mode 100644 backup.rails2.3/plugins/translate/lib/translate/routes.rb
create mode 100644 backup.rails2.3/plugins/translate/lib/translate/storage.rb
create mode 100644 backup.rails2.3/plugins/translate/lib/translate_controller.rb
create mode 100644 backup.rails2.3/plugins/translate/lib/translate_helper.rb
create mode 100644 backup.rails2.3/plugins/translate/spec/controllers/translate_controller_spec.rb
create mode 100644 backup.rails2.3/plugins/translate/spec/file_spec.rb
create mode 100644 backup.rails2.3/plugins/translate/spec/files/translate/app/models/article.rb
create mode 100644 backup.rails2.3/plugins/translate/spec/files/translate/app/views/category.erb
create mode 100644 backup.rails2.3/plugins/translate/spec/files/translate/app/views/category.html
create mode 100644 backup.rails2.3/plugins/translate/spec/files/translate/app/views/category.html.erb
create mode 100644 backup.rails2.3/plugins/translate/spec/files/translate/app/views/category.rhtml
create mode 100644 backup.rails2.3/plugins/translate/spec/files/translate/public/javascripts/application.js
create mode 100644 backup.rails2.3/plugins/translate/spec/keys_spec.rb
create mode 100644 backup.rails2.3/plugins/translate/spec/log_spec.rb
create mode 100644 backup.rails2.3/plugins/translate/spec/spec_helper.rb
create mode 100644 backup.rails2.3/plugins/translate/spec/storage_spec.rb
create mode 100644 backup.rails2.3/plugins/translate/tasks/translate.rake
create mode 100644 backup.rails2.3/plugins/translate/views/layouts/translate.rhtml
create mode 100644 backup.rails2.3/plugins/translate/views/translate/_pagination.rhtml
create mode 100644 backup.rails2.3/plugins/translate/views/translate/index.rhtml
create mode 100644 backup.rails2.3/production.rb.rails2
create mode 100644 backup.rails2.3/routes.rb.rails2
create mode 100644 config/initializers/tracks.rb
diff --git a/backup.rails2.3/Gemfile.rails2.3 b/backup.rails2.3/Gemfile.rails2.3
new file mode 100644
index 00000000..dc3af876
--- /dev/null
+++ b/backup.rails2.3/Gemfile.rails2.3
@@ -0,0 +1,65 @@
+source :gemcutter
+source "http://gems.github.com/"
+
+gem "rake", "~>0.8.7"
+gem "rails", "~>2.3.12"
+gem "highline", "~>1.5.0"
+gem "RedCloth", "4.2.8"
+gem "sanitize", "~>1.2.1"
+gem "rack", "1.1.0"
+gem "will_paginate", "~> 2.3.15"
+gem "has_many_polymorphs", "~> 2.13"
+gem "acts_as_list", "~>0.1.4"
+gem "aasm", "~>2.2.0"
+gem "rubyjedi-actionwebservice", :require => "actionwebservice"
+gem "rubycas-client", "~>2.2.1"
+gem "ruby-openid", :require => "openid"
+
+# you may comment out the database driver you will not be using.
+# This will prevent a native build of the driver. Building native drivers is not always possible on all hosters
+gem "sqlite3"
+gem "mysql"
+
+gem 'bcrypt-ruby', '~> 2.1.4'
+gem 'htmlentities', '~> 4.3.0'
+gem "mail"
+
+if RUBY_VERSION.to_f >= 1.9
+ gem "soap4r-ruby1.9"
+else
+ gem "soap4r", "~>1.5.8"
+end
+
+group :development do
+ if RUBY_VERSION.to_f >= 1.9
+ gem "ruby-debug19"
+ gem "mongrel", "1.2.0.pre2"
+ else
+ gem "ruby-debug"
+ gem "mongrel"
+ end
+ gem "yard"
+end
+
+group :test do
+ gem "test-unit", "1.2.3"
+ gem "flexmock"
+ gem "ZenTest", ">=4.0.0"
+ gem "hpricot"
+ gem "hoe"
+ gem "rspec-rails", "~>1.3.3"
+ gem "thoughtbot-factory_girl"
+ gem 'memory_test_fix', '~>0.1.3'
+ gem "capybara", ">=0.3.5"
+ gem "selenium-webdriver" # Note that > 2.14 has problems: https://code.google.com/p/selenium/issues/detail?id=3075
+ gem "database_cleaner", ">=0.5.0"
+ gem "cucumber-rails", "~>0.3.2"
+ gem "aruba", "0.2.2", :path => "vendor/gems/aruba-0.2.2"
+
+ # uncomment to use the webkit option. This depends on Qt to be installed
+ #gem "capybara-webkit"
+
+ # uncomment to be able to make screenshots from scenarios
+ #gem "capybara-screenshot"
+ #gem "launchy"
+end
diff --git a/backup.rails2.3/Gemfile.rails3 b/backup.rails2.3/Gemfile.rails3
new file mode 100644
index 00000000..c07b2b6a
--- /dev/null
+++ b/backup.rails2.3/Gemfile.rails3
@@ -0,0 +1,39 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.3'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3'
+gem 'mysql'
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer', :platform => :ruby
+
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# To use Jbuilder templates for JSON
+# gem 'jbuilder'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
diff --git a/backup.rails2.3/app/apis/todo_api.rb b/backup.rails2.3/app/apis/todo_api.rb
new file mode 100644
index 00000000..5f980a64
--- /dev/null
+++ b/backup.rails2.3/app/apis/todo_api.rb
@@ -0,0 +1,22 @@
+class TodoApi < ActionWebService::API::Base
+ api_method :new_todo,
+ :expects => [{:username => :string}, {:token => :string}, {:context_id => :int}, {:description => :string}, {:notes => :string}],
+ :returns => [:int]
+
+ api_method :new_todo_for_project,
+ :expects => [{:username => :string}, {:token => :string}, {:context_id => :int}, {:project_id => :int}, {:description => :string}, {:notes => :string}],
+ :returns => [:int]
+
+ api_method :new_rich_todo,
+ :expects => [{:username => :string}, {:token => :string}, {:default_context_id => :int}, {:description => :string}, {:notes => :string}],
+ :returns => [:int]
+
+ api_method :list_contexts,
+ :expects => [{:username => :string}, {:token => :string}],
+ :returns => [[Context]]
+
+ api_method :list_projects,
+ :expects => [{:username => :string}, {:token => :string}],
+ :returns => [[Project]]
+
+end
diff --git a/backup.rails2.3/application_helper.rb.rails2 b/backup.rails2.3/application_helper.rb.rails2
new file mode 100644
index 00000000..39c591e4
--- /dev/null
+++ b/backup.rails2.3/application_helper.rb.rails2
@@ -0,0 +1,301 @@
+# The methods added to this helper will be available to all templates in the
+# application.
+module ApplicationHelper
+
+ # Replicates the link_to method but also checks request.request_uri to find
+ # current page. If that matches the url, the link is marked id = "current"
+ #
+ def navigation_link(name, options = {}, html_options = nil, *parameters_for_method_reference)
+ if html_options
+ html_options = html_options.stringify_keys
+ convert_options_to_javascript!(html_options)
+ tag_options = tag_options(html_options)
+ else
+ tag_options = nil
+ end
+ url = options.is_a?(String) ? options : self.url_for(options, *parameters_for_method_reference)
+ id_tag = (request.request_uri == url) ? " id=\"current\"" : ""
+
+ "#{name || url}"
+ end
+
+ def days_from_today(date)
+ date.in_time_zone.to_date - current_user.time.to_date
+ end
+
+ # Check due date in comparison to today's date Flag up date appropriately with
+ # a 'traffic light' colour code
+ #
+ def due_date(due)
+ return "" if due.nil?
+
+ days = days_from_today(due)
+
+ colors = ['amber','amber','orange','orange','orange','orange','orange','orange']
+ color = :red if days < 0
+ color = :green if days > 7
+ color = colors[days] if color.nil?
+
+ return content_tag(:a, {:title => format_date(due)}) {
+ content_tag(:span, {:class => color}) {
+ case days
+ when 0
+ t('todos.next_actions_due_date.due_today')
+ when 1
+ t('todos.next_actions_due_date.due_tomorrow')
+ when 2..7
+ if prefs.due_style == Preference.due_styles[:due_on]
+ # TODO: internationalize strftime here
+ t('models.preference.due_on', :date => due.strftime("%A"))
+ else
+ t('models.preference.due_in', :days => days)
+ end
+ else
+ # overdue or due very soon! sound the alarm!
+ if days == -1
+ t('todos.next_actions_due_date.overdue_by', :days => days * -1)
+ elsif days < -1
+ t('todos.next_actions_due_date.overdue_by_plural', :days => days * -1)
+ else
+ # more than a week away - relax
+ t('models.preference.due_in', :days => days)
+ end
+ end
+ }
+ }
+ end
+
+ # Check due date in comparison to today's date Flag up date appropriately with
+ # a 'traffic light' colour code Modified method for mobile screen
+ #
+ def due_date_mobile(due)
+ if due == nil
+ return ""
+ end
+
+ days = days_from_today(due)
+
+ case days
+ when 0
+ ""+ format_date(due) + ""
+ when 1
+ "" + format_date(due) + ""
+ # due 2-7 days away
+ when 2..7
+ "" + format_date(due) + ""
+ else
+ # overdue or due very soon! sound the alarm!
+ if days < 0
+ "" + format_date(due) +""
+ else
+ # more than a week away - relax
+ "" + format_date(due) + ""
+ end
+ end
+ end
+
+ # Returns a count of next actions in the given context or project. The result
+ # is count and a string descriptor, correctly pluralised if there are no
+ # actions or multiple actions
+ #
+ def count_undone_todos_phrase(todos_parent, string="actions")
+ @controller.count_undone_todos_phrase(todos_parent, string)
+ end
+
+ def count_undone_todos_phrase_text(todos_parent, string="actions")
+ count_undone_todos_phrase(todos_parent, string).gsub(" "," ")
+ end
+
+ def count_undone_todos_and_notes_phrase(project, string="actions")
+ s = count_undone_todos_phrase(project, string)
+ s += ", #{pluralize(project.note_count, 'note')}" unless project.note_count == 0
+ s
+ end
+
+ def link_to_context(context, descriptor = sanitize(context.name))
+ link_to( descriptor, context, :title => "View context: #{context.name}" )
+ end
+
+ def link_to_project(project, descriptor = sanitize(project.name))
+ link_to( descriptor, project, :title => "View project: #{project.name}" )
+ end
+
+ def link_to_edit_note (note, descriptor = sanitize(note.id.to_s))
+ link_to(descriptor,
+ url_for({:controller => 'notes', :action => 'edit', :id => note.id}),
+ {:id => "link_edit_#{dom_id(note)}", :class => "note_edit_settings"})
+ end
+
+ def link_to_project_mobile(project, accesskey, descriptor = sanitize(project.name))
+ link_to( descriptor, project_path(project, :format => 'm'), {:title => "View project: #{project.name}", :accesskey => accesskey} )
+ end
+
+ def item_link_to_context(item)
+ descriptor = "[C]"
+ descriptor = "[#{item.context.name}]" if prefs.verbose_action_descriptors
+ link_to_context( item.context, descriptor )
+ end
+
+ def item_link_to_project(item)
+ descriptor = "[P]"
+ descriptor = "[#{item.project.name}]" if prefs.verbose_action_descriptors
+ link_to_project( item.project, descriptor )
+ end
+
+ def render_flash
+ render :partial => 'shared/flash', :object => flash
+ end
+
+ def recurrence_time_span(rt)
+ case rt.ends_on
+ when "no_end_date"
+ return rt.start_from.nil? ? "" : I18n.t("todos.recurrence.pattern.from") + " " + format_date(rt.start_from)
+ when "ends_on_number_of_times"
+ return I18n.t("todos.recurrence.pattern.times", :number => rt.number_of_occurences)
+ when "ends_on_end_date"
+ starts = rt.start_from.nil? ? "" : I18n.t("todos.recurrence.pattern.from") + " " + format_date(rt.start_from)
+ ends = rt.end_date.nil? ? "" : " " + I18n.t("todos.recurrence.pattern.until") + " " + format_date(rt.end_date)
+ return starts+ends
+ else
+ raise Exception.new, "unknown recurrence time span selection (#{rt.ends_on})"
+ end
+ end
+
+ def recurrence_pattern_as_text(recurring_todo)
+ rt = recurring_todo.recurring_target_as_text
+ rp = recurring_todo.recurrence_pattern
+ # only add space if recurrence_pattern has content
+ rp = " " + rp if !rp.nil?
+ rts = recurrence_time_span(recurring_todo)
+ # only add space if recurrence_time_span has content
+ rts = " " + rts if !(rts == "")
+ return rt+rp+rts
+ end
+
+ def date_format_for_date_picker()
+ standard_format = current_user.prefs.date_format
+ translations = [
+ ['%m', 'mm'],
+ ['%b', 'M'],
+ ['%B', 'MM'],
+ ['%d', 'dd'],
+ ['%a', 'D'],
+ ['%A', 'DD'],
+ ['%y', 'y'],
+ ['%Y', 'yy']
+ ]
+ translations.inject(standard_format) do |str, translation|
+ str.gsub(*translation)
+ end
+ end
+
+ AUTO_LINK_MESSAGE_RE = %r{message://<[^>]+>} unless const_defined?(:AUTO_LINK_MESSAGE_RE)
+
+ # Converts message:// links to href. This URL scheme is used on Mac OS X
+ # to link to a mail message in Mail.app.
+ def auto_link_message(text)
+ text.gsub(AUTO_LINK_MESSAGE_RE) do
+ href = $&
+ left, right = $`, $'
+ # detect already linked URLs and URLs in the middle of a tag
+ if left =~ /<[^>]+$/ && right =~ /^[^>]*>/
+ # do not change string; URL is alreay linked
+ href
+ else
+ content = content_tag(:a, h(href), :href => h(href))
+ end
+ end
+ end
+
+ def format_note(note)
+ note = auto_link_message(note)
+ note = markdown(note)
+ note = auto_link(note, :link => :urls)
+
+ # add onenote and message protocols
+ Sanitize::Config::RELAXED[:protocols]['a']['href'] << 'onenote'
+ Sanitize::Config::RELAXED[:protocols]['a']['href'] << 'message'
+
+ note = Sanitize.clean(note, Sanitize::Config::RELAXED)
+ return note
+ end
+
+ def sidebar_html_for_titled_list (list, title)
+ return content_tag(:h3, title+" (#{list.length})") +
+ content_tag(:ul, sidebar_html_for_list(list))
+ end
+
+ def sidebar_html_for_list(list)
+ if list.empty?
+ return content_tag(:li, t('sidebar.list_empty'))
+ else
+ return list.inject("") do |html, item|
+ link = (item.class == "Project") ? link_to_project( item ) : link_to_context(item)
+ html << content_tag(:li, link + " (" + count_undone_todos_phrase(item,"actions")+")")
+ end
+ end
+ end
+
+ def generate_i18n_strings
+ js = "i18n_locale='#{I18n.locale}';\n"
+ js << "i18n = new Array();\n"
+ %w{
+ shared.toggle_multi shared.toggle_multi_title
+ shared.hide_form shared.hide_action_form_title
+ shared.toggle_single shared.toggle_single_title
+ projects.hide_form projects.hide_form_title
+ projects.show_form projects.show_form_title
+ contexts.hide_form contexts.hide_form_title
+ contexts.show_form contexts.show_form_title
+ contexts.new_context_pre contexts.new_context_post
+ common.cancel common.ok
+ common.ajaxError todos.unresolved_dependency
+ }.each do |s|
+ js << "i18n['#{s}'] = '#{ t(s).gsub(/'/, "\\\\'") }';\n"
+ end
+ return js
+ end
+
+ def javascript_tag_for_i18n_datepicker
+ locale = I18n.locale
+ # do not include en as locale since this the available by default
+ if locale and locale != :en
+ javascript_include_tag("i18n/jquery.ui.datepicker-#{locale}.js")
+ end
+ end
+
+ def determine_done_path
+ case @controller.controller_name
+ when "contexts"
+ done_todos_context_path(@context)
+ when "projects"
+ done_todos_project_path(@project)
+ when "todos"
+ if source_view_is(:tag)
+ done_tag_path(@tag_name)
+ else
+ done_todos_path
+ end
+ else
+ done_todos_path
+ end
+ end
+
+ def determine_all_done_path
+ case @controller.controller_name
+ when "contexts"
+ all_done_todos_context_path(@context)
+ when "projects"
+ all_done_todos_project_path(@project)
+ when "todos"
+ if source_view_is(:tag)
+ all_done_tag_path(@tag_name)
+ else
+ all_done_todos_path
+ end
+ else
+ all_done_todos_path
+ end
+ end
+
+end
diff --git a/backup.rails2.3/database.yml.rails2 b/backup.rails2.3/database.yml.rails2
new file mode 100644
index 00000000..da7aebc8
--- /dev/null
+++ b/backup.rails2.3/database.yml.rails2
@@ -0,0 +1,37 @@
+# MySQL. Versions 4.1 and 5.0 are recommended.
+#
+#
+# Be sure to use new-style password hashing:
+# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
+development:
+ adapter: mysql
+ database: tracks_trunk
+ encoding: utf8
+ host: localhost
+ username: tracks
+ password: 32tracks55
+
+mdevelopment:
+ adapter: sqlite3
+ database: db/tracks-21-test.sqlite3.db
+
+test: &TEST
+# adapter: sqlite3
+# database: ":memory:"
+# verbosity: quiet
+ adapter: mysql
+ database: tracks_test
+ host: localhost
+ username: tracks
+ password: 32tracks55
+
+production:
+ adapter: mysql
+ database: tracks_trunk
+ encoding: utf8
+ host: localhost
+ username: tracks
+ password: 32tracks55
+
+cucumber:
+ <<: *TEST
diff --git a/backup.rails2.3/development.rb.rails2 b/backup.rails2.3/development.rb.rails2
new file mode 100644
index 00000000..05c880d7
--- /dev/null
+++ b/backup.rails2.3/development.rb.rails2
@@ -0,0 +1,19 @@
+# In the development environment your application's code is reloaded on
+# every request. This slows down response time but is perfect for development
+# since you don't have to restart the webserver when you make code changes.
+config.cache_classes = false
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching = false
+
+# Don't care if the mailer can't send
+config.action_mailer.raise_delivery_errors = false
+
+# Unique cookies
+config.action_controller.session = { :key => 'TracksDev' }
+
+NOTIFY_BAR="
"
diff --git a/backup.rails2.3/environment.rb.rails2 b/backup.rails2.3/environment.rb.rails2
new file mode 100644
index 00000000..390f585b
--- /dev/null
+++ b/backup.rails2.3/environment.rb.rails2
@@ -0,0 +1,119 @@
+# Be sure to restart your webserver when you modify this file.
+# Uncomment below to force Rails into production mode
+
+# (Use only when you can't set environment variables through your web/app server)
+# ENV['RAILS_ENV'] = 'production'
+
+# Bootstrap the Rails environment, frameworks, and default configuration
+require File.join(File.dirname(__FILE__), 'boot')
+
+require 'yaml'
+SITE_CONFIG = YAML.load_file(File.join(File.dirname(__FILE__), 'site.yml'))
+
+class Rails::Configuration
+ attr_accessor :action_web_service
+end
+
+Encoding.default_external = Encoding::UTF_8 if RUBY_VERSION > "1.9"
+
+Rails::Initializer.run do |config|
+ # Skip frameworks you're not going to use
+ # config.frameworks -= [ :action_web_service, :action_mailer ]
+ config.autoload_paths += %W( #{RAILS_ROOT}/app/apis )
+
+ config.action_controller.use_accept_header = true
+
+ # Use the database for sessions instead of the file system
+ # (create the session table with 'rake create_sessions_table')
+ config.action_controller.session_store = :active_record_store
+
+ config.action_controller.session = {
+ :key => '_tracks_session_id',
+ :secret => SITE_CONFIG['salt'] * (30.0 / SITE_CONFIG['salt'].length).ceil #must be at least 30 characters
+ }
+
+ config.action_controller.relative_url_root = SITE_CONFIG['subdir'] if SITE_CONFIG['subdir']
+
+ # Enable page/fragment caching by setting a file-based store
+ # (remember to create the caching directory and make it readable to the application)
+ # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
+
+ # Activate observers that should always be running
+ # config.active_record.observers = :cacher, :garbage_collector
+
+ # Make Active Record use UTC-base instead of local time
+ config.active_record.default_timezone = :utc
+
+ # You''ll probably want to change this to the time zone of the computer where Tracks is running
+ # run rake time:zones:local have Rails suggest time zone names on your system
+ config.time_zone = SITE_CONFIG['time_zone']
+
+ # Use Active Record's schema dumper instead of SQL when creating the test database
+ # (enables use of different database adapters for development and test environments)
+ config.active_record.schema_format = :ruby
+
+ # allow other protocols in urls for sanitzer. Add to your liking, for example
+ # config.action_view.sanitized_allowed_protocols = 'onenote', 'blah', 'proto'
+ # to enable "link":onenote://... or "link":blah://... hyperlinks
+ config.action_view.sanitized_allowed_protocols = 'onenote', 'message'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+end
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
+
+# Include your application configuration below
+
+
+require 'name_part_finder'
+require 'tracks/todo_list'
+require 'tracks/config'
+require 'tagging_extensions' # Needed for tagging-specific extensions
+require 'digest/sha1' #Needed to support 'rake db:fixtures:load' on some ruby installs: http://dev.rousette.org.uk/ticket/557
+
+if ( SITE_CONFIG['authentication_schemes'].include? 'ldap')
+ require 'net/ldap' #requires ruby-net-ldap gem be installed
+ require 'simple_ldap_authenticator'
+ ldap = SITE_CONFIG['ldap']
+ SimpleLdapAuthenticator.ldap_library = ldap['library']
+ SimpleLdapAuthenticator.servers = ldap['servers']
+ SimpleLdapAuthenticator.use_ssl = ldap['ssl']
+ SimpleLdapAuthenticator.login_format = ldap['login_format']
+end
+
+if ( SITE_CONFIG['authentication_schemes'].include? 'open_id')
+ #requires ruby-openid gem to be installed
+ OpenID::Util.logger = RAILS_DEFAULT_LOGGER
+end
+
+if ( SITE_CONFIG['authentication_schemes'].include? 'cas')
+ #requires rubycas-client gem to be installed
+ if defined? CASClient
+ require 'casclient/frameworks/rails/filter'
+ CASClient::Frameworks::Rails::Filter.configure(
+ :cas_base_url => SITE_CONFIG['cas_server'] ,
+ :cas_server_logout => SITE_CONFIG['cas_server_logout']
+ )
+ end
+end
+
+# changed in development.rb to show under_construction bar
+NOTIFY_BAR = "" unless defined?(NOTIFY_BAR)
+
+tracks_version='2.2devel'
+# comment out next two lines if you do not want (or can not) the date of the
+# last git commit in the footer
+info=`git log --pretty=format:"%ai" -1`
+tracks_version=tracks_version + ' ('+info+')'
+
+TRACKS_VERSION=tracks_version
diff --git a/backup.rails2.3/lib/assets/.gitkeep b/backup.rails2.3/lib/assets/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/backup.rails2.3/lib/authenticated_test_helper.rb b/backup.rails2.3/lib/authenticated_test_helper.rb
new file mode 100644
index 00000000..7a52e62b
--- /dev/null
+++ b/backup.rails2.3/lib/authenticated_test_helper.rb
@@ -0,0 +1,113 @@
+module AuthenticatedTestHelper
+ # Sets the current user in the session from the user fixtures.
+ def login_as(user)
+ @request.session['user_id'] = user ? users(user).id : nil
+ end
+
+ def content_type(type)
+ @request.env['Content-Type'] = type
+ end
+
+ def accept(accept)
+ @request.env["HTTP_ACCEPT"] = accept
+ end
+
+ def authorize_as(user)
+ if user
+ @request.env["HTTP_AUTHORIZATION"] = "Basic #{Base64.encode64("#{users(user).login}:test")}"
+ accept 'application/xml'
+ content_type 'application/xml'
+ else
+ @request.env["HTTP_AUTHORIZATION"] = nil
+ accept nil
+ content_type nil
+ end
+ end
+
+ # http://project.ioni.st/post/217#post-217
+ #
+ # def test_new_publication
+ # assert_difference(Publication, :count) do
+ # post :create, :publication => {...}
+ # # ...
+ # end
+ # end
+ #
+ def assert_difference(object, method = nil, difference = 1)
+ initial_value = object.send(method)
+ yield
+ assert_equal initial_value + difference, object.send(method), "#{object}##{method}"
+ end
+
+ def assert_no_difference(object, method, &block)
+ assert_difference object, method, 0, &block
+ end
+
+ # Assert the block redirects to the login
+ #
+ # assert_requires_login(:bob) { |c| c.get :edit, :id => 1 }
+ #
+ def assert_requires_login(login = nil)
+ yield HttpLoginProxy.new(self, login)
+ end
+
+ def assert_http_authentication_required(login = nil)
+ yield XmlLoginProxy.new(self, login)
+ end
+
+ def reset!(*instance_vars)
+ instance_vars = [:controller, :request, :response] unless instance_vars.any?
+ instance_vars.collect! { |v| "@#{v}".to_sym }
+ instance_vars.each do |var|
+ instance_variable_set(var, instance_variable_get(var).class.new)
+ end
+ end
+end
+
+class BaseLoginProxy
+ attr_reader :controller
+ attr_reader :options
+ def initialize(controller, login)
+ @controller = controller
+ @login = login
+ end
+
+ private
+ def authenticated
+ raise NotImplementedError
+ end
+
+ def check
+ raise NotImplementedError
+ end
+
+ def method_missing(method, *args)
+ @controller.reset!
+ authenticate
+ @controller.send(method, *args)
+ check
+ end
+end
+
+class HttpLoginProxy < BaseLoginProxy
+ protected
+ def authenticate
+ @controller.login_as @login if @login
+ end
+
+ def check
+ @controller.assert_redirected_to :controller => 'account', :action => 'login'
+ end
+end
+
+class XmlLoginProxy < BaseLoginProxy
+ protected
+ def authenticate
+ @controller.accept 'application/xml'
+ @controller.authorize_as @login if @login
+ end
+
+ def check
+ @controller.assert_response 401
+ end
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/login_system.rb b/backup.rails2.3/lib/login_system.rb
new file mode 100644
index 00000000..bc25de08
--- /dev/null
+++ b/backup.rails2.3/lib/login_system.rb
@@ -0,0 +1,222 @@
+require_dependency "user"
+
+module LoginSystem
+
+ def current_user
+ get_current_user
+ end
+
+ def prefs
+ current_user.prefs unless current_user.nil?
+ end
+
+ # Logout the {#current_user} and redirect to login page
+ #
+ # @param [String] message notification to display
+ def logout_user message=t('login.logged_out')
+ @user.forget_me if logged_in?
+ cookies.delete :auth_token
+ session['user_id'] = nil
+ if ( SITE_CONFIG['authentication_schemes'].include? 'cas') && session[:cas_user]
+ CASClient::Frameworks::Rails::Filter.logout(self)
+ else
+ reset_session
+ notify :notice, message
+ redirect_to_login
+ end
+ end
+
+ protected
+
+ # overwrite this if you want to restrict access to only a few actions
+ # or if you want to check if the user has the correct rights
+ # example:
+ #
+ # # only allow nonbobs
+ # def authorize?(user)
+ # user.login != "bob"
+ # end
+ def authorize?(user)
+ true
+ end
+
+ # overwrite this method if you only want to protect certain actions of the controller
+ # example:
+ #
+ # # don't protect the login and the about method
+ # def protect?(action)
+ # if ['action', 'about'].include?(action)
+ # return false
+ # else
+ # return true
+ # end
+ # end
+ def protect?(action)
+ true
+ end
+
+ # When called with before_filter :login_from_cookie will check for an :auth_token
+ # cookie and log the user back in if appropriate
+ def login_from_cookie
+ return unless cookies[:auth_token] && !logged_in?
+ token = cookies[:auth_token]
+ user = User.where(:remember_token => token)
+ if user && user.remember_token?
+ session['user_id'] = user.id
+ set_current_user(user)
+ current_user.remember_me
+ cookies[:auth_token] = { :value => current_user.remember_token , :expires => current_user.remember_token_expires_at, :secure => SITE_CONFIG['secure_cookies'] }
+ flash[:notice] = t('login.successful')
+ end
+ end
+
+ def login_or_feed_token_required
+ if ['rss', 'atom', 'txt', 'ics'].include?(params[:format])
+ if user = User.find_by_token(params[:token])
+ set_current_user(user)
+ return true
+ end
+ end
+ login_required
+ end
+
+ # login_required filter. add
+ #
+ # before_filter :login_required
+ #
+ # if the controller should be under any rights management.
+ # for finer access control you can overwrite
+ #
+ # def authorize?(user)
+ #
+ def login_required
+
+ if not protect?(action_name)
+ return true
+ end
+
+ login_from_cookie
+
+ if session['user_id'] and authorize?(get_current_user)
+ return true
+ end
+
+ http_user, http_pass = get_basic_auth_data
+ if user = User.authenticate(http_user, http_pass)
+ session['user_id'] = user.id
+ set_current_user(user)
+ return true
+ end
+
+ # store current location so that we can
+ # come back after the user logged in
+ store_location unless params[:format] == 'js'
+
+ # call overwriteable reaction to unauthorized access
+ access_denied
+ return false
+ end
+
+ def login_optional
+
+ login_from_cookie
+
+ if session['user_id'] and authorize?(get_current_user)
+ return true
+ end
+
+ http_user, http_pass = get_basic_auth_data
+ if user = User.authenticate(http_user, http_pass)
+ session['user_id'] = user.id
+ set_current_user(user)
+ return true
+ end
+
+ return true
+ end
+
+ def logged_in?
+ current_user != nil
+ end
+
+ def get_current_user
+ if @user.nil? && session['user_id']
+ @user = User.find(session['user_id'])
+ end
+ @user
+ end
+
+ def set_current_user(user)
+ @user = user
+ end
+
+ # overwrite if you want to have special behavior in case the user is not authorized
+ # to access the current operation.
+ # the default action is to redirect to the login screen
+ # example use :
+ # a popup window might just close itself for instance
+ def access_denied
+ respond_to do |format|
+ format.html { redirect_to login_path }
+ format.m { redirect_to formatted_login_path(:format => 'm') }
+ format.js { render :partial => 'login/redirect_to_login' }
+ format.xml { basic_auth_denied }
+ format.rss { basic_auth_denied }
+ format.atom { basic_auth_denied }
+ format.text { basic_auth_denied }
+ end
+ end
+
+ # store current uri in the session.
+ # we can return to this location by calling return_location
+ def store_location
+ session['return-to'] = request.request_uri
+ end
+
+ # move to the last store_location call or to the passed default one
+ def redirect_back_or_default(default)
+ if session['return-to'].nil?
+ redirect_to default
+ else
+ redirect_to session['return-to']
+ session['return-to'] = nil
+ end
+ end
+
+ # HTTP Basic auth code adapted from Coda Hale's simple_http_auth plugin. Thanks, Coda!
+ def get_basic_auth_data
+
+ auth_locations = ['REDIRECT_REDIRECT_X_HTTP_AUTHORIZATION',
+ 'REDIRECT_X_HTTP_AUTHORIZATION',
+ 'X-HTTP_AUTHORIZATION', 'HTTP_AUTHORIZATION']
+
+ authdata = nil
+ for location in auth_locations
+ if request.env.has_key?(location)
+ authdata = request.env[location].to_s.split
+ end
+ end
+ if authdata and authdata[0] == 'Basic'
+ user, pass = Base64.decode64(authdata[1]).split(':')[0..1]
+ else
+ user, pass = ['', '']
+ end
+ return user, pass
+ end
+
+ def basic_auth_denied
+ response.headers["WWW-Authenticate"] = "Basic realm=\"'Tracks Login Required'\""
+ render :text => t('login.unsuccessful'), :status => 401
+ end
+
+private
+
+ # Redirect the user to the login page.
+ def redirect_to_login
+ respond_to do |format|
+ format.html { redirect_to login_path }
+ format.m { redirect_to login_path(:format => 'm') }
+ end
+ end
+
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/name_part_finder.rb b/backup.rails2.3/lib/name_part_finder.rb
new file mode 100644
index 00000000..79d66338
--- /dev/null
+++ b/backup.rails2.3/lib/name_part_finder.rb
@@ -0,0 +1,5 @@
+module NamePartFinder
+ def find_by_namepart(namepart)
+ find_by_name(namepart) || find(:first, :conditions => ["name LIKE ?", namepart + '%'])
+ end
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/tagging_extensions.rb b/backup.rails2.3/lib/tagging_extensions.rb
new file mode 100644
index 00000000..2808f42a
--- /dev/null
+++ b/backup.rails2.3/lib/tagging_extensions.rb
@@ -0,0 +1,200 @@
+class ActiveRecord::Base #:nodoc:
+
+ # These extensions make models taggable. This file is automatically generated and required by your app if you run the tagging generator included with has_many_polymorphs.
+ module TaggingExtensions
+
+ # Add tags to self. Accepts a string of tagnames, an array of tagnames, an array of ids, or an array of Tags.
+ #
+ # We need to avoid name conflicts with the built-in ActiveRecord association methods, thus the underscores.
+ def _add_tags incoming
+ taggable?(true)
+ tag_cast_to_string(incoming).each do |tag_name|
+ # added following check to prevent empty tags from being saved (which will fail)
+ unless tag_name.blank?
+ begin
+ tag = Tag.find_or_create_by_name(tag_name)
+ raise Tag::Error, "tag could not be saved: #{tag_name}" if tag.new_record?
+ tags << tag
+ rescue ActiveRecord::StatementInvalid => e
+ raise unless e.to_s =~ /duplicate/i
+ end
+ end
+ end
+ end
+
+ # Removes tags from self. Accepts a string of tagnames, an array of tagnames, an array of ids, or an array of Tags.
+ def _remove_tags outgoing
+ taggable?(true)
+ outgoing = tag_cast_to_string(outgoing)
+ tags.delete(*(tags.select do |tag|
+ outgoing.include? tag.name
+ end))
+ end
+
+ # Returns the tags on self as a string.
+ def tag_list
+ # Redefined later to avoid an RDoc parse error.
+ end
+
+ # Replace the existing tags on self. Accepts a string of tagnames, an array of tagnames, an array of ids, or an array of Tags.
+ def tag_with list
+ #:stopdoc:
+ taggable?(true)
+ list = tag_cast_to_string(list)
+
+ # Transactions may not be ideal for you here; be aware.
+ Tag.transaction do
+ current = tags.map(&:name)
+ _add_tags(list - current)
+ _remove_tags(current - list)
+ end
+
+ self
+ #:startdoc:
+ end
+
+ # Returns the tags on self as a string.
+ def tag_list #:nodoc:
+ #:stopdoc:
+ taggable?(true)
+ tags.reload
+ tags.to_s
+ #:startdoc:
+ end
+
+ def tag_list=(value)
+ tag_with(value)
+ end
+
+ private
+
+ def tag_cast_to_string obj #:nodoc:
+ case obj
+ when Array
+ obj.map! do |item|
+ case item
+ # removed next line as it prevents using numbers as tags
+ # when /^\d+$/, Fixnum then Tag.find(item).name # This will be slow if you use ids a lot.
+ when Tag then item.name
+ when String then item
+ else
+ raise "Invalid type"
+ end
+ end
+ when String
+ obj = obj.split(Tag::DELIMITER).map do |tag_name|
+ tag_name.strip.squeeze(" ")
+ end
+ else
+ raise "Invalid object of class #{obj.class} as tagging method parameter"
+ end.flatten.compact.map(&:downcase).uniq
+ end
+
+ # Check if a model is in the :taggables target list. The alternative to this check is to explicitly include a TaggingMethods module (which you would create) in each target model.
+ def taggable?(should_raise = false) #:nodoc:
+ unless flag = respond_to?(:tags)
+ raise "#{self.class} is not a taggable model" if should_raise
+ end
+ flag
+ end
+
+ end
+
+ module TaggingFinders
+ # Find all the objects tagged with the supplied list of tags
+ #
+ # Usage : Model.tagged_with("ruby")
+ # Model.tagged_with("hello", "world")
+ # Model.tagged_with("hello", "world", :limit => 10)
+ #
+ # XXX This query strategy is not performant, and needs to be rewritten as an inverted join or a series of unions
+ #
+ def tagged_with(*tag_list)
+ options = tag_list.last.is_a?(Hash) ? tag_list.pop : {}
+ tag_list = parse_tags(tag_list)
+
+ scope = scope(:find)
+ options[:select] ||= "#{table_name}.*"
+ options[:from] ||= "#{table_name}, tags, taggings"
+
+ sql = "SELECT #{(scope && scope[:select]) || options[:select]} "
+ sql << "FROM #{(scope && scope[:from]) || options[:from]} "
+
+ add_joins!(sql, options[:joins], scope)
+
+ sql << "WHERE #{table_name}.#{primary_key} = taggings.taggable_id "
+ sql << "AND taggings.taggable_type = '#{ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s}' "
+ sql << "AND taggings.tag_id = tags.id "
+
+ tag_list_condition = tag_list.map {|name| "'#{name}'"}.join(", ")
+
+ sql << "AND (tags.name IN (#{sanitize_sql(tag_list_condition)})) "
+ sql << "AND #{sanitize_sql(options[:conditions])} " if options[:conditions]
+
+ columns = column_names.map do |column|
+ "#{table_name}.#{column}"
+ end.join(", ")
+
+ sql << "GROUP BY #{columns} "
+ sql << "HAVING COUNT(taggings.tag_id) = #{tag_list.size}"
+
+ add_order!(sql, options[:order], scope)
+ add_limit!(sql, options, scope)
+ add_lock!(sql, options, scope)
+
+ find_by_sql(sql)
+ end
+
+ def self.tagged_with_any(*tag_list)
+ options = tag_list.last.is_a?(Hash) ? tag_list.pop : {}
+ tag_list = parse_tags(tag_list)
+
+ scope = scope(:find)
+ options[:select] ||= "#{table_name}.*"
+ options[:from] ||= "#{table_name}, meta_tags, taggings"
+
+ sql = "SELECT #{(scope && scope[:select]) || options[:select]} "
+ sql << "FROM #{(scope && scope[:from]) || options[:from]} "
+
+ add_joins!(sql, options, scope)
+
+ sql << "WHERE #{table_name}.#{primary_key} = taggings.taggable_id "
+ sql << "AND taggings.taggable_type = '#{ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s}' "
+ sql << "AND taggings.meta_tag_id = meta_tags.id "
+
+ sql << "AND ("
+ or_options = []
+ tag_list.each do |name|
+ or_options << "meta_tags.name = '#{name}'"
+ end
+ or_options_joined = or_options.join(" OR ")
+ sql << "#{or_options_joined}) "
+
+
+ sql << "AND #{sanitize_sql(options[:conditions])} " if options[:conditions]
+
+ columns = column_names.map do |column|
+ "#{table_name}.#{column}"
+ end.join(", ")
+
+ sql << "GROUP BY #{columns} "
+
+ add_order!(sql, options[:order], scope)
+ add_limit!(sql, options, scope)
+ add_lock!(sql, options, scope)
+
+ find_by_sql(sql)
+ end
+
+ def parse_tags(tags)
+ return [] if tags.blank?
+ tags = Array(tags).first
+ tags = tags.respond_to?(:flatten) ? tags.flatten : tags.split(Tag::DELIMITER)
+ tags.map { |tag| tag.strip.squeeze(" ") }.flatten.compact.map(&:downcase).uniq
+ end
+
+ end
+
+ include TaggingExtensions
+ extend TaggingFinders
+end
diff --git a/backup.rails2.3/lib/tasks/.gitkeep b/backup.rails2.3/lib/tasks/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/backup.rails2.3/lib/tasks/cucumber-tracks.rake b/backup.rails2.3/lib/tasks/cucumber-tracks.rake
new file mode 100644
index 00000000..ae5bdfad
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/cucumber-tracks.rake
@@ -0,0 +1,38 @@
+# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
+# It is recommended to regenerate this file in the future when you upgrade to a
+# newer version of cucumber-rails. Consider adding your own code to a new file
+# instead of editing this one. Cucumber will automatically load all features/**/*.rb
+# files.
+
+vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
+$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
+
+begin
+ require 'cucumber/rake/task'
+
+ namespace :cucumber do
+ Cucumber::Rake::Task.new({:selenium => :env_to_selenium}, 'Run features that require selenium') do |t|
+ t.binary = vendored_cucumber_bin
+ t.fork = true # You may get faster startup if you set this to false
+ t.profile = 'selenium'
+ end
+
+ Cucumber::Rake::Task.new({:selenium_wip => :env_to_selenium}, 'Run unfinished features that require selenium') do |t|
+ t.binary = vendored_cucumber_bin
+ t.fork = true # You may get faster startup if you set this to false
+ t.profile = 'selenium_wip'
+ end
+
+ task :env_to_selenium => 'db:test:prepare' do
+ ENV['RAILS_ENV'] = 'selenium'
+ end
+
+ desc 'Run all features'
+ task :all => [:ok, :wip, :selenium, :selenium_wip]
+ end
+rescue LoadError
+ desc 'cucumber rake task not available (cucumber not installed)'
+ task :cucumber do
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
+ end
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/tasks/cucumber.rake b/backup.rails2.3/lib/tasks/cucumber.rake
new file mode 100644
index 00000000..7db1a557
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/cucumber.rake
@@ -0,0 +1,53 @@
+# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
+# It is recommended to regenerate this file in the future when you upgrade to a
+# newer version of cucumber-rails. Consider adding your own code to a new file
+# instead of editing this one. Cucumber will automatically load all features/**/*.rb
+# files.
+
+
+unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
+
+vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
+$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
+
+begin
+ require 'cucumber/rake/task'
+
+ namespace :cucumber do
+ Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
+ t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
+ t.fork = true # You may get faster startup if you set this to false
+ t.profile = 'default'
+ end
+
+ Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
+ t.binary = vendored_cucumber_bin
+ t.fork = true # You may get faster startup if you set this to false
+ t.profile = 'wip'
+ end
+
+ Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
+ t.binary = vendored_cucumber_bin
+ t.fork = true # You may get faster startup if you set this to false
+ t.profile = 'rerun'
+ end
+
+ desc 'Run all features'
+ task :all => [:ok, :wip]
+ end
+ desc 'Alias for cucumber:ok'
+ task :cucumber => 'cucumber:ok'
+
+ task :default => :cucumber
+
+ task :features => :cucumber do
+ STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
+ end
+rescue LoadError
+ desc 'cucumber rake task not available (cucumber not installed)'
+ task :cucumber do
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
+ end
+end
+
+end
diff --git a/backup.rails2.3/lib/tasks/database.rake b/backup.rails2.3/lib/tasks/database.rake
new file mode 100644
index 00000000..eb02a45f
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/database.rake
@@ -0,0 +1,27 @@
+require 'rake'
+
+namespace :db do
+ desc "Dump the current SQLite3 or MySQL database to a sql file"
+ task :dump_sql do
+ load 'config/environment.rb'
+ abcs = ActiveRecord::Base.configurations
+ case abcs[RAILS_ENV]["adapter"]
+ when 'mysql'
+ ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
+ File.open("db/#{RAILS_ENV}_data.sql", "w+") do |f|
+ if abcs[RAILS_ENV]["password"].blank?
+ f << `mysqldump -h #{abcs[RAILS_ENV]["host"]} -u #{abcs[RAILS_ENV]["username"]} #{abcs[RAILS_ENV]["database"]}`
+ else
+ f << `mysqldump -h #{abcs[RAILS_ENV]["host"]} -u #{abcs[RAILS_ENV]["username"]} -p#{abcs[RAILS_ENV]["password"]} #{abcs[RAILS_ENV]["database"]}`
+ end
+ end
+ when 'sqlite3'
+ ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
+ File.open("db/#{RAILS_ENV}_data.sql", "w+") do |f|
+ f << `sqlite3 #{abcs[RAILS_ENV]["database"]} .dump`
+ end
+ else
+ raise "Task not supported by '#{abcs[RAILS_ENV]['adapter']}'"
+ end
+ end
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/tasks/extract_fixtures.rake b/backup.rails2.3/lib/tasks/extract_fixtures.rake
new file mode 100644
index 00000000..f69683a3
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/extract_fixtures.rake
@@ -0,0 +1,17 @@
+desc ' Create YAML test fixtures from data in an existing database.
+Defaults to development database. Set RAILS_ENV to override (taken from Rails Recipes book).'
+task :extract_fixtures => :environment do
+ sql = "SELECT * FROM %s"
+ skip_tables = ["schema_info", "sessions", "users"]
+ ActiveRecord::Base.establish_connection
+ (ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
+ i = "000"
+ File.open("#{RAILS_ROOT}/db/exported_fixtures/#{table_name}.yml", 'w' ) do |file|
+ data = ActiveRecord::Base.connection.select_all(sql % table_name)
+ file.write data.inject({}) { |hash, record|
+ hash["#{table_name}_#{i.succ!}"] = record
+ hash
+ }.to_yaml
+ end
+ end
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/tasks/gems.rake b/backup.rails2.3/lib/tasks/gems.rake
new file mode 100644
index 00000000..464b787f
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/gems.rake
@@ -0,0 +1,34 @@
+desc "Copy third-party gems into ./lib"
+task :freeze_other_gems do
+ # TODO Get this list from parsing environment.rb
+ libraries = %w(redcloth)
+ require 'rubygems'
+ require 'find'
+
+ libraries.each do |library|
+ library_gem = Gem.cache.search(library).sort_by { |g| g.version }.last
+ puts "Freezing #{library} for #{library_gem.version}..."
+
+ # TODO Add dependencies to list of libraries to freeze
+ #library_gem.dependencies.each { |g| libraries << g }
+
+ folder_for_library = "#{library_gem.name}-#{library_gem.version}"
+ system "cd vendor; gem unpack -v '#{library_gem.version}' #{library_gem.name};"
+
+ # Copy files recursively to ./lib
+ folder_for_library_with_lib = "vendor/#{folder_for_library}/lib/"
+ Find.find(folder_for_library_with_lib) do |original_file|
+ destination_file = "./lib/" + original_file.gsub(folder_for_library_with_lib, '')
+
+ if File.directory?(original_file)
+ if !File.exist?(destination_file)
+ Dir.mkdir destination_file
+ end
+ else
+ File.copy original_file, destination_file
+ end
+ end
+
+ system "rm -r vendor/#{folder_for_library}"
+ end
+end
diff --git a/backup.rails2.3/lib/tasks/load_exported_fixtures.rake b/backup.rails2.3/lib/tasks/load_exported_fixtures.rake
new file mode 100644
index 00000000..10757471
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/load_exported_fixtures.rake
@@ -0,0 +1,8 @@
+desc "Load exported fixtures (in db/exported_fixtures) into the current environment's database"
+task :load_exported_fixtures => :environment do
+ require 'active_record/fixtures'
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
+ Dir.glob(File.join(RAILS_ROOT, 'db', 'exported_fixtures', '*.{yml,csv}')).each do |fixture_file|
+ Fixtures.create_fixtures('db/exported_fixtures', File.basename(fixture_file, '.*'))
+ end
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/tasks/query_trace_toggle.rake b/backup.rails2.3/lib/tasks/query_trace_toggle.rake
new file mode 100644
index 00000000..a6321541
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/query_trace_toggle.rake
@@ -0,0 +1,50 @@
+namespace :query_trace do
+ desc "Enables the query_trace plugin. Must restart server to take effect."
+ task :on => :environment do
+ unless File.exist?("#{RAILS_ROOT}/vendor/query_trace.tar.gz")
+ Dir.chdir("#{RAILS_ROOT}/vendor") do
+ url = "https://terralien.devguard.com/svn/projects/plugins/query_trace"
+ puts "Loading query_trace from #{url}..."
+ system "svn co #{url} query_trace"
+ system "tar zcf query_trace.tar.gz --exclude=.svn query_trace"
+ FileUtils.rm_rf("query_trace")
+ end
+ end
+ Dir.chdir("#{RAILS_ROOT}/vendor/plugins") do
+ system "tar zxf ../query_trace.tar.gz query_trace"
+ end
+ puts "QueryTrace plugin enabled. Must restart server to take effect."
+ end
+
+ desc "Disables the query_trace plugin. Must restart server to take effect."
+ task :off => :environment do
+ FileUtils.rm_rf("#{RAILS_ROOT}/vendor/plugins/query_trace")
+ puts "QueryTrace plugin disabled. Must restart server to take effect."
+ end
+end
+
+namespace :query_analyzer do
+ desc "Enables the query_analyzer plugin. Must restart server to take effect."
+ task :on => :environment do
+ unless File.exist?("#{RAILS_ROOT}/vendor/query_analyzer.tar.gz")
+ Dir.chdir("#{RAILS_ROOT}/vendor") do
+ url = "http://svn.nfectio.us/plugins/query_analyzer"
+ puts "Loading query_analyzer from #{url}..."
+ system "svn co #{url} query_analyzer"
+ system "tar zcf query_analyzer.tar.gz --exclude=.svn query_analyzer"
+ FileUtils.rm_rf("query_analyzer")
+ end
+ end
+ Dir.chdir("#{RAILS_ROOT}/vendor/plugins") do
+ system "tar zxf ../query_analyzer.tar.gz query_analyzer"
+ end
+ puts "QueryAnalyzer plugin enabled. Must restart server to take effect."
+ end
+
+ desc "Disables the query_analyzer plugin. Must restart server to take effect."
+ task :off => :environment do
+ FileUtils.rm_rf("#{RAILS_ROOT}/vendor/plugins/query_analyzer")
+ puts "QueryAnalyzer plugin disabled. Must restart server to take effect."
+ end
+end
+
diff --git a/backup.rails2.3/lib/tasks/reset_password.rake b/backup.rails2.3/lib/tasks/reset_password.rake
new file mode 100644
index 00000000..6cc61a60
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/reset_password.rake
@@ -0,0 +1,23 @@
+namespace :tracks do
+ desc 'Replace the password of USER with a new one.'
+ task :password => :environment do
+ require "highline/import"
+
+ user = User.find_by_login(ENV['USER'])
+ if user.nil?
+ puts "Sorry, we couldn't find user '#{ENV['USER']}'. To specify a different user, pass USER=username to this task."
+ exit 0
+ end
+
+ puts "Changing Tracks password for #{ENV['USER']}."
+ password = ask("New password: ") { |q| q.echo = false }
+ password_confirmation = ask('Retype new password: ') { |q| q.echo = false }
+
+ begin
+ user.change_password(password, password_confirmation)
+ rescue ActiveRecord::RecordInvalid
+ puts "Sorry, we couldn't change #{ENV['USER']}'s password: "
+ user.errors.each_full { |msg| puts "- #{msg}\n" }
+ end
+ end
+end
diff --git a/backup.rails2.3/lib/tasks/rspec.rake b/backup.rails2.3/lib/tasks/rspec.rake
new file mode 100644
index 00000000..dba3ffcc
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/rspec.rake
@@ -0,0 +1,144 @@
+gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
+rspec_gem_dir = nil
+Dir["#{RAILS_ROOT}/vendor/gems/*"].each do |subdir|
+ rspec_gem_dir = subdir if subdir.gsub("#{RAILS_ROOT}/vendor/gems/","") =~ /^(\w+-)?rspec-(\d+)/ && File.exist?("#{subdir}/lib/spec/rake/spectask.rb")
+end
+rspec_plugin_dir = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec')
+
+if rspec_gem_dir && (test ?d, rspec_plugin_dir)
+ raise "\n#{'*'*50}\nYou have rspec installed in both vendor/gems and vendor/plugins\nPlease pick one and dispose of the other.\n#{'*'*50}\n\n"
+end
+
+if rspec_gem_dir
+ $LOAD_PATH.unshift("#{rspec_gem_dir}/lib")
+elsif File.exist?(rspec_plugin_dir)
+ $LOAD_PATH.unshift("#{rspec_plugin_dir}/lib")
+end
+
+# Don't load rspec if running "rake gems:*"
+unless ARGV.any? {|a| a =~ /^gems/}
+
+begin
+ require 'spec/rake/spectask'
+rescue MissingSourceFile
+ module Spec
+ module Rake
+ class SpecTask
+ def initialize(name)
+ task name do
+ # if rspec-rails is a configured gem, this will output helpful material and exit ...
+ require File.expand_path(File.join(File.dirname(__FILE__),"..","..","config","environment"))
+
+ # ... otherwise, do this:
+ raise <<-MSG
+
+#{"*" * 80}
+* You are trying to run an rspec rake task defined in
+* #{__FILE__},
+* but rspec can not be found in vendor/gems, vendor/plugins or system gems.
+#{"*" * 80}
+MSG
+ end
+ end
+ end
+ end
+ end
+end
+
+Rake.application.instance_variable_get('@tasks').delete('default')
+
+spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
+task :noop do
+end
+
+task :default => :spec
+task :stats => "spec:statsetup"
+
+desc "Run all specs in spec directory (excluding plugin specs)"
+Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+namespace :spec do
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = lambda do
+ IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
+ end
+ end
+
+ desc "Print Specdoc for all specs (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ end
+
+ desc "Print Specdoc for all plugin examples"
+ Spec::Rake::SpecTask.new(:plugin_doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*')
+ end
+
+ [:models, :controllers, :views, :helpers, :lib, :integration].each do |sub|
+ desc "Run the code examples in spec/#{sub}"
+ Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
+ end
+ end
+
+ desc "Run the code examples in vendor/plugins (except RSpec's own)"
+ Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
+ end
+
+ namespace :plugins do
+ desc "Runs the examples for rspec_on_rails"
+ Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb']
+ end
+ end
+
+ # Setup specs for stats
+ task :statsetup do
+ require 'code_statistics'
+ ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
+ ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
+ ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
+ ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
+ ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
+ ::STATS_DIRECTORIES << %w(Routing\ specs spec/routing) if File.exist?('spec/routing')
+ ::STATS_DIRECTORIES << %w(Integration\ specs spec/integration) if File.exist?('spec/integration')
+ ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
+ ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
+ ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
+ ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
+ ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
+ ::CodeStatistics::TEST_TYPES << "Routing specs" if File.exist?('spec/routing')
+ ::CodeStatistics::TEST_TYPES << "Integration specs" if File.exist?('spec/integration')
+ end
+
+ namespace :db do
+ namespace :fixtures do
+ desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z."
+ task :load => :environment do
+ ActiveRecord::Base.establish_connection(Rails.env)
+ base_dir = File.join(Rails.root, 'spec', 'fixtures')
+ fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir
+
+ require 'active_record/fixtures'
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file|
+ Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*'))
+ end
+ end
+ end
+ end
+end
+
+end
diff --git a/backup.rails2.3/lib/tasks/setup_tracks.rake b/backup.rails2.3/lib/tasks/setup_tracks.rake
new file mode 100644
index 00000000..0881dfb3
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/setup_tracks.rake
@@ -0,0 +1,15 @@
+desc "Initialises the installation, copy the *.tmpl files and directories to versions named without the .tmpl extension. It won't overwrite the files and directories if you've already copied them. You need to manually copy database.yml.tmpl -> database.yml and fill in the details before you run this task."
+task :setup_tracks => :environment do
+ # Check the root directory for template files
+ FileList["*.tmpl"].each do |template_file|
+ f = File.basename(template_file) # with suffix
+ f_only = File.basename(template_file,".tmpl") # without suffix
+ if File.exists?(f_only)
+ puts f_only + " already exists"
+ else
+ cp_r(f, f_only)
+ puts f_only + " created"
+ end
+ end
+
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/tasks/upgrade_sqlite_db.rake b/backup.rails2.3/lib/tasks/upgrade_sqlite_db.rake
new file mode 100644
index 00000000..8e96fb18
--- /dev/null
+++ b/backup.rails2.3/lib/tasks/upgrade_sqlite_db.rake
@@ -0,0 +1,40 @@
+desc "Updates sqlite/sqlite3 databases created under Tracks 1.03 to the format required for Tracks 1.04. After this is done, you should be able to keep up to date with changes in the schema by running rake db:migrate."
+task :upgrade_sqlite_db => :environment do
+ # Change the three lines below appropriately for your setup
+ old_db = "tracks_103.db"
+ new_db = "tracks_104.db"
+ cmd = "sqlite3"
+ replace_string = "update todos set done='f' where done=0;\nupdate todos set done='t' where done=1;\nupdate contexts set hide='f' where hide=0;\nupdate contexts set hide='t' where hide=1;\nupdate projects set done='f' where done=0;\nupdate projects set done='t' where done=1;\nCREATE TABLE 'schema_info' (\n 'version' INTEGER default NULL\n);\nINSERT INTO \"schema_info\" VALUES(1);\nCOMMIT;"
+
+ # cd to the db directory
+ cd("db") do
+ # Dump the old db into the temp file and replace the tinyints with booleans
+ `#{cmd} #{old_db} .dump | sed "s/tinyint(4) NOT NULL default '0'/boolean default 'f'/" > temp.sql`
+ # Create a second sqldump file for writing
+ sqldump = File.open("temp2.sql", "w+")
+ File.open("temp.sql") do |file|
+ file.each_line do |line|
+ # If COMMIT is on the line, insert the replace string
+ # else just write the line back in
+ # This effectively replaces COMMIT with the replace string
+ if /COMMIT/ =~ line
+ sqldump.write replace_string
+ else
+ sqldump.write line
+ end
+ end
+ sqldump.close
+ end
+
+ # Read the second dump back in to a new db
+ system "#{cmd} #{new_db} < temp2.sql"
+ puts "Created the a new database called #{new_db}."
+ # Clean up the temp files
+ rm("temp.sql")
+ rm("temp2.sql")
+ puts "Temporary files cleaned up."
+ end
+
+ # rake db:migrate
+ puts "Now check the database and run 'rake db:migrate' in the root of your Tracks installation."
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/tracks/config.rb b/backup.rails2.3/lib/tracks/config.rb
new file mode 100644
index 00000000..0ca04f97
--- /dev/null
+++ b/backup.rails2.3/lib/tracks/config.rb
@@ -0,0 +1,27 @@
+module Tracks
+ class Config
+ def self.salt
+ SITE_CONFIG['salt']
+ end
+
+ def self.auth_schemes
+ SITE_CONFIG['authentication_schemes'] || []
+ end
+
+ def self.openid_enabled?
+ auth_schemes.include?('open_id')
+ end
+
+ def self.cas_enabled?
+ auth_schemes.include?('cas')
+ end
+
+ def self.prefered_auth?
+ if SITE_CONFIG['prefered_auth']
+ SITE_CONFIG['prefered_auth']
+ else
+ auth_schemes.first
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/backup.rails2.3/lib/tracks/source_view.rb b/backup.rails2.3/lib/tracks/source_view.rb
new file mode 100644
index 00000000..8cb17ca8
--- /dev/null
+++ b/backup.rails2.3/lib/tracks/source_view.rb
@@ -0,0 +1,68 @@
+# Inspiration from Bruce Williams [http://codefluency.com/articles/2006/07/01/rails-views-getting-in-context/]
+module Tracks
+
+ module SourceViewSwitching
+
+ class Responder
+
+ def initialize(source_view)
+ @source_view = source_view.underscore.gsub(/\s+/,'_').to_sym rescue nil
+ end
+
+ def nil?
+ yield if @source_view.nil? && block_given?
+ end
+
+ def context
+ yield if :context == @source_view && block_given?
+ end
+
+ def method_missing(check_source_view,*args)
+ yield if check_source_view == @source_view && block_given?
+ end
+
+ end
+
+ module Controller
+
+ def self.included(base)
+ base.send(:helper, Tracks::SourceViewSwitching::Helper)
+ base.send(:helper_method, :source_view)
+ end
+
+ def source_view_is( s )
+ s == (params[:_source_view] || @source_view).to_sym
+ end
+
+ def source_view_is_one_of( *s )
+ s.include?(params[:_source_view].to_sym)
+ end
+
+ def source_view
+ responder = Tracks::SourceViewSwitching::Responder.new(params[:_source_view] || @source_view)
+ block_given? ? yield(responder) : responder
+ end
+
+ end
+
+ module Helper
+
+ def source_view_tag(name)
+ hidden_field_tag :_source_view, name.underscore.gsub(/\s+/,'_')
+ end
+
+ def source_view_is( s )
+ s == (params[:_source_view] || @source_view).to_sym
+ end
+
+ def source_view_is_one_of( *s )
+ s.include?(params[:_source_view].to_sym)
+ end
+
+ end
+
+ end
+
+end
+
+ActionController::Base.send(:include, Tracks::SourceViewSwitching::Controller)
diff --git a/backup.rails2.3/lib/tracks/todo_list.rb b/backup.rails2.3/lib/tracks/todo_list.rb
new file mode 100644
index 00000000..b1a32229
--- /dev/null
+++ b/backup.rails2.3/lib/tracks/todo_list.rb
@@ -0,0 +1,59 @@
+module Tracks
+ module TodoList
+ # TODO: this module should be deprecated. This could mostly (all?) be replaced by named scopes)
+
+ def not_done_todos(opts={})
+ @not_done_todos ||= self.find_not_done_todos(opts)
+ end
+
+ def done_todos
+ @done_todos ||= self.find_done_todos
+ end
+
+ def deferred_todos
+ @deferred_todos ||= self.find_deferred_todos
+ end
+
+ def find_not_done_todos(opts={})
+ with_not_done_scope(opts) do
+ self.todos.find(:all, :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC")
+ end
+ end
+
+ def find_deferred_todos(opts={})
+ self.todos.find_in_state(:all, :deferred, :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC")
+ end
+
+ def find_done_todos
+ self.todos.completed.all(:order => "todos.completed_at DESC", :limit => self.user.prefs.show_number_completed)
+ end
+
+ def not_done_todo_count(opts={})
+ with_not_done_scope(opts) do
+ self.todos.count
+ end
+ end
+
+ def with_not_done_scope(opts={})
+ conditions = ["todos.state = ?", 'active']
+ if opts.has_key?(:include_project_hidden_todos) && (opts[:include_project_hidden_todos] == true)
+ conditions = ["(todos.state = ? OR todos.state = ?)", 'active', 'project_hidden']
+ end
+ if opts.has_key?(:tag)
+ conditions = ["todos.state = ? AND taggings.tag_id = ?", 'active', opts[:tag]]
+ end
+ self.todos.send :with_scope, :find => {:conditions => conditions, :include => [:taggings]} do
+ yield
+ end
+ end
+
+ def done_todo_count
+ self.todos.count_in_state(:completed)
+ end
+
+ def deferred_todo_count
+ self.todos.count_in_state(:deferred)
+ end
+
+ end
+end
diff --git a/backup.rails2.3/mongrel_workaround.rb b/backup.rails2.3/mongrel_workaround.rb
new file mode 100644
index 00000000..60b207b9
--- /dev/null
+++ b/backup.rails2.3/mongrel_workaround.rb
@@ -0,0 +1,107 @@
+# adapted from https://gist.github.com/471663 and https://rails.lighthouseapp.com/projects/8994/tickets/4690-mongrel-doesnt-work-with-rails-238
+
+def check_mongrel_around_115
+begin
+ # Gem.available? is deprecated from rubygems 1.8.2
+ Gem::Specification::find_by_name "mongrel", "~>1.1.5"
+ rescue
+ if RUBY_VERSION[2] == "9"
+ false
+ else
+ Gem.available?('mongrel', '~>1.1.5')
+ end
+ end
+end
+
+mongrel115 = check_mongrel_around_115
+
+if Rails.version == '2.3.14' && mongrel115 && self.class.const_defined?(:Mongrel)
+
+ # Pulled right from latest rack. Old looked like this in 1.1.0 version.
+ #
+ # def [](k)
+ # super(@names[k] ||= @names[k.downcase])
+ # end
+ #
+ module Rack
+ module Utils
+ class HeaderHash < Hash
+ def [](k)
+ super(@names[k]) if @names[k]
+ super(@names[k.downcase])
+ end
+ end
+ end
+ end
+
+ # Code pulled from the ticket above.
+ #
+ class Mongrel::CGIWrapper
+ def header_with_rails_fix(options = 'text/html')
+ @head['cookie'] = options.delete('cookie').flatten.map { |v| v.sub(/^\n/,'') } if options.class != String and options['cookie']
+ header_without_rails_fix(options)
+ end
+ alias_method_chain :header, :rails_fix
+ end
+
+ # Pulled right from 2.3.10 ActionPack. Simple diff was
+ #
+ # if headers.include?('Set-Cookie')
+ # headers['cookie'] = headers.delete('Set-Cookie').split("\n")
+ # end
+ #
+ # to
+ #
+ # if headers['Set-Cookie']
+ # headers['cookie'] = headers.delete('Set-Cookie').split("\n")
+ # end
+ #
+ module ActionController
+ class CGIHandler
+ def self.dispatch_cgi(app, cgi, out = $stdout)
+ env = cgi.__send__(:env_table)
+ env.delete "HTTP_CONTENT_LENGTH"
+
+ cgi.stdinput.extend ProperStream
+
+ env["SCRIPT_NAME"] = "" if env["SCRIPT_NAME"] == "/"
+
+ env.update({
+ "rack.version" => [0,1],
+ "rack.input" => cgi.stdinput,
+ "rack.errors" => $stderr,
+ "rack.multithread" => false,
+ "rack.multiprocess" => true,
+ "rack.run_once" => false,
+ "rack.url_scheme" => ["yes", "on", "1"].include?(env["HTTPS"]) ? "https" : "http"
+ })
+
+ env["QUERY_STRING"] ||= ""
+ env["HTTP_VERSION"] ||= env["SERVER_PROTOCOL"]
+ env["REQUEST_PATH"] ||= "/"
+ env.delete "PATH_INFO" if env["PATH_INFO"] == ""
+
+ status, headers, body = app.call(env)
+ begin
+ out.binmode if out.respond_to?(:binmode)
+ out.sync = false if out.respond_to?(:sync=)
+
+ headers['Status'] = status.to_s
+
+ if headers['Set-Cookie']
+ headers['cookie'] = headers.delete('Set-Cookie').split("\n")
+ end
+
+ out.write(cgi.header(headers))
+
+ body.each { |part|
+ out.write part
+ out.flush if out.respond_to?(:flush)
+ }
+ ensure
+ body.close if body.respond_to?(:close)
+ end
+ end
+ end
+ end
+end
diff --git a/backup.rails2.3/new_rails_defaults.rb b/backup.rails2.3/new_rails_defaults.rb
new file mode 100644
index 00000000..c94db0a6
--- /dev/null
+++ b/backup.rails2.3/new_rails_defaults.rb
@@ -0,0 +1,21 @@
+# Be sure to restart your server when you modify this file.
+
+# These settings change the behavior of Rails 2 apps and will be defaults
+# for Rails 3. You can remove this initializer when Rails 3 is released.
+
+if defined?(ActiveRecord)
+ # Include Active Record class name as root for JSON serialized output.
+ ActiveRecord::Base.include_root_in_json = true
+
+ # Store the full class name (including module namespace) in STI type column.
+ ActiveRecord::Base.store_full_sti_class = true
+end
+
+ActionController::Routing.generate_best_match = false
+
+# Use ISO 8601 format for JSON serialized times and dates.
+ActiveSupport.use_standard_json_time_format = true
+
+# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
+# if you're including raw json in an HTML page.
+ActiveSupport.escape_html_entities_in_json = false
\ No newline at end of file
diff --git a/backup.rails2.3/plugins/extra_validations/init.rb b/backup.rails2.3/plugins/extra_validations/init.rb
new file mode 100644
index 00000000..17709ad4
--- /dev/null
+++ b/backup.rails2.3/plugins/extra_validations/init.rb
@@ -0,0 +1,2 @@
+require 'extra_validations'
+ActiveRecord::Base.extend ExtraValidations
\ No newline at end of file
diff --git a/backup.rails2.3/plugins/extra_validations/lib/extra_validations.rb b/backup.rails2.3/plugins/extra_validations/lib/extra_validations.rb
new file mode 100644
index 00000000..be50b659
--- /dev/null
+++ b/backup.rails2.3/plugins/extra_validations/lib/extra_validations.rb
@@ -0,0 +1,29 @@
+module ExtraValidations
+
+ # Validates the value of the specified attribute by checking for a forbidden string
+ #
+ # class Person < ActiveRecord::Base
+ # validates_does_not_contain :first_name, :string => ','
+ # end
+ #
+ # A string must be provided or else an exception will be raised.
+ #
+ # Configuration options:
+ # * message - A custom error message (default is: "is invalid")
+ # * string - The string to verify is not included (note: must be supplied!)
+ # * on Specifies when this validation is active (default is :save, other options :create, :update)
+ # * if - Specifies a method, proc or string to call to determine if the validation should
+ # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
+ # method, proc or string should return or evaluate to a true or false value.
+ def validates_does_not_contain(*attr_names)
+ configuration = { :message => I18n.translate('activerecord.errors.messages')[:invalid], :on => :save, :string => nil }
+ configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)
+
+ raise(ArgumentError, "A string must be supplied as the :string option of the configuration hash") unless configuration[:string].is_a?(String)
+
+ validates_each(attr_names, configuration) do |record, attr_name, value|
+ record.errors.add(attr_name, configuration[:message]) if value.to_s =~ Regexp.new(Regexp.escape(configuration[:string]))
+ end
+ end
+
+end
diff --git a/backup.rails2.3/plugins/open_id_authentication/CHANGELOG b/backup.rails2.3/plugins/open_id_authentication/CHANGELOG
new file mode 100644
index 00000000..7349bd3c
--- /dev/null
+++ b/backup.rails2.3/plugins/open_id_authentication/CHANGELOG
@@ -0,0 +1,35 @@
+* Fake HTTP method from OpenID server since they only support a GET. Eliminates the need to set an extra route to match the server's reply. [Josh Peek]
+
+* OpenID 2.0 recommends that forms should use the field name "openid_identifier" rather than "openid_url" [Josh Peek]
+
+* Return open_id_response.display_identifier to the application instead of .endpoints.claimed_id. [nbibler]
+
+* Add Timeout protection [Rick]
+
+* An invalid identity url passed through authenticate_with_open_id will no longer raise an InvalidOpenId exception. Instead it will return Result[:missing] to the completion block.
+
+* Allow a return_to option to be used instead of the requested url [Josh Peek]
+
+* Updated plugin to use Ruby OpenID 2.x.x [Josh Peek]
+
+* Tied plugin to ruby-openid 1.1.4 gem until we can make it compatible with 2.x [DHH]
+
+* Use URI instead of regexps to normalize the URL and gain free, better matching #8136 [dkubb]
+
+* Allow -'s in #normalize_url [Rick]
+
+* remove instance of mattr_accessor, it was breaking tests since they don't load ActiveSupport. Fix Timeout test [Rick]
+
+* Throw a InvalidOpenId exception instead of just a RuntimeError when the URL can't be normalized [DHH]
+
+* Just use the path for the return URL, so extra query parameters don't interfere [DHH]
+
+* Added a new default database-backed store after experiencing trouble with the filestore on NFS. The file store is still available as an option [DHH]
+
+* Added normalize_url and applied it to all operations going through the plugin [DHH]
+
+* Removed open_id? as the idea of using the same input box for both OpenID and username has died -- use using_open_id? instead (which checks for the presence of params[:openid_url] by default) [DHH]
+
+* Added OpenIdAuthentication::Result to make it easier to deal with default situations where you don't care to do something particular for each error state [DHH]
+
+* Stop relying on root_url being defined, we can just grab the current url instead [DHH]
\ No newline at end of file
diff --git a/backup.rails2.3/plugins/open_id_authentication/README b/backup.rails2.3/plugins/open_id_authentication/README
new file mode 100644
index 00000000..807cdc75
--- /dev/null
+++ b/backup.rails2.3/plugins/open_id_authentication/README
@@ -0,0 +1,231 @@
+OpenIdAuthentication
+====================
+
+Provides a thin wrapper around the excellent ruby-openid gem from JanRan. Be sure to install that first:
+
+ gem install ruby-openid
+
+To understand what OpenID is about and how it works, it helps to read the documentation for lib/openid/consumer.rb
+from that gem.
+
+The specification used is http://openid.net/specs/openid-authentication-2_0.html.
+
+
+Prerequisites
+=============
+
+OpenID authentication uses the session, so be sure that you haven't turned that off. It also relies on a number of
+database tables to store the authentication keys. So you'll have to run the migration to create these before you get started:
+
+ rake open_id_authentication:db:create
+
+Or, use the included generators to install or upgrade:
+
+ ./script/generate open_id_authentication_tables MigrationName
+ ./script/generate upgrade_open_id_authentication_tables MigrationName
+
+Alternatively, you can use the file-based store, which just relies on on tmp/openids being present in RAILS_ROOT. But be aware that this store only works if you have a single application server. And it's not safe to use across NFS. It's recommended that you use the database store if at all possible. To use the file-based store, you'll also have to add this line to your config/environment.rb:
+
+ OpenIdAuthentication.store = :file
+
+This particular plugin also relies on the fact that the authentication action allows for both POST and GET operations.
+If you're using RESTful authentication, you'll need to explicitly allow for this in your routes.rb.
+
+The plugin also expects to find a root_url method that points to the home page of your site. You can accomplish this by using a root route in config/routes.rb:
+
+ map.root :controller => 'articles'
+
+This plugin relies on Rails Edge revision 6317 or newer.
+
+
+Example
+=======
+
+This example is just to meant to demonstrate how you could use OpenID authentication. You might well want to add
+salted hash logins instead of plain text passwords and other requirements on top of this. Treat it as a starting point,
+not a destination.
+
+Note that the User model referenced in the simple example below has an 'identity_url' attribute. You will want to add the same or similar field to whatever
+model you are using for authentication.
+
+Also of note is the following code block used in the example below:
+
+ authenticate_with_open_id do |result, identity_url|
+ ...
+ end
+
+In the above code block, 'identity_url' will need to match user.identity_url exactly. 'identity_url' will be a string in the form of 'http://example.com' -
+If you are storing just 'example.com' with your user, the lookup will fail.
+
+There is a handy method in this plugin called 'normalize_url' that will help with validating OpenID URLs.
+
+ OpenIdAuthentication.normalize_url(user.identity_url)
+
+The above will return a standardized version of the OpenID URL - the above called with 'example.com' will return 'http://example.com/'
+It will also raise an InvalidOpenId exception if the URL is determined to not be valid.
+Use the above code in your User model and validate OpenID URLs before saving them.
+
+config/routes.rb
+
+ map.root :controller => 'articles'
+ map.resource :session
+
+
+app/views/sessions/new.erb
+
+ <% form_tag(session_url) do %>
+