Permalink
Browse files

upgraded to rails3 using rails_upgrade plugin

  • Loading branch information...
1 parent 17f9bea commit 0aab0ec2c8046b4057c8101734232f65d291d808 @jschoolcraft committed Jun 28, 2010
Showing with 11,468 additions and 375 deletions.
  1. +2 −20 .gitignore
  2. +22 −0 .gitignore.rails2
  3. +2 −0 .rvmrc
  4. +19 −19 Gemfile
  5. +65 −0 Gemfile.lock
  6. +281 −0 README
  7. +2 −5 Rakefile
  8. +3 −45 app/controllers/application_controller.rb
  9. +46 −0 app/controllers/application_controller.rb.rails2
  10. +0 −1 app/helpers/application_helper.rb
  11. +3 −0 app/helpers/application_helper.rb.rails2
  12. +4 −0 config.ru
  13. +11 −0 config/application.rb
  14. +13 −124 config/boot.rb
  15. +23 −0 config/database.yml
  16. +23 −0 config/database.yml.rails2
  17. +4 −14 config/environment.rb
  18. +15 −0 config/environment.rb.rails2
  19. +15 −15 config/environments/development.rb
  20. +19 −0 config/environments/development.rb.rails2
  21. +38 −20 config/environments/production.rb
  22. +28 −0 config/environments/production.rb.rails2
  23. +28 −0 config/environments/staging.rb.rails2
  24. +27 −19 config/environments/test.rb
  25. +2 −2 config/initializers/backtrace_silencers.rb
  26. +7 −0 config/initializers/secret_token.rb
  27. +2 −9 config/initializers/session_store.rb
  28. +1 −1 config/locales/en.yml
  29. +43 −25 config/routes.rb
  30. +27 −0 config/routes.rb.rails2
  31. +7 −0 db/seeds.rb
  32. +2 −0 doc/README_FOR_APP.rails2
  33. +105 −0 doc/upgrade_notes.txt
  34. 0 lib/tasks/.gitkeep
  35. +15 −19 public/404.html
  36. +15 −19 public/422.html
  37. +14 −18 public/500.html
  38. BIN public/images/rails.png
  39. +279 −0 public/index.html
  40. +965 −0 public/javascripts/controls.js
  41. +974 −0 public/javascripts/dragdrop.js
  42. +1,123 −0 public/javascripts/effects.js
  43. +4,874 −0 public/javascripts/prototype.js
  44. +118 −0 public/javascripts/rails.js
  45. 0 public/stylesheets/.gitkeep
  46. +362 −0 public/stylesheets/application.css
  47. +99 −0 public/stylesheets/pagination.css
  48. +50 −0 public/stylesheets/text.css
  49. +8 −0 public/stylesheets/tools.css
  50. +6 −0 script/rails
  51. +9 −0 test/performance/browsing_test.rb
  52. +13 −0 test/test_helper.rb
  53. 0 vendor/plugins/.gitkeep
  54. +20 −0 vendor/plugins/rails_upgrade/MIT-LICENSE
  55. +20 −0 vendor/plugins/rails_upgrade/README
  56. +22 −0 vendor/plugins/rails_upgrade/Rakefile
  57. +2 −0 vendor/plugins/rails_upgrade/init.rb
  58. +38 −0 vendor/plugins/rails_upgrade/install.rb
  59. +433 −0 vendor/plugins/rails_upgrade/lib/application_checker.rb
  60. +95 −0 vendor/plugins/rails_upgrade/lib/gemfile_generator.rb
  61. +51 −0 vendor/plugins/rails_upgrade/lib/new_configuration_generator.rb
  62. 0 vendor/plugins/rails_upgrade/lib/rails_upgrade.rb
  63. +349 −0 vendor/plugins/rails_upgrade/lib/routes_upgrader.rb
  64. +78 −0 vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake
  65. +264 −0 vendor/plugins/rails_upgrade/test/application_checker_test.rb
  66. +72 −0 vendor/plugins/rails_upgrade/test/gemfile_generator_test.rb
  67. +63 −0 vendor/plugins/rails_upgrade/test/new_configuration_generator_test.rb
  68. +142 −0 vendor/plugins/rails_upgrade/test/routes_upgrader_test.rb
  69. +5 −0 vendor/plugins/rails_upgrade/test/test_helper.rb
  70. +1 −0 vendor/plugins/rails_upgrade/uninstall.rb
View
22 .gitignore
@@ -1,22 +1,4 @@
-.DS_Store
-log/*.log
-tmp/**/*
+.bundle
db/*.sqlite3
-config/database.yml
-coverage/*
-coverage.data
-*~
-public/stylesheets/application.css
-public/stylesheets/text.css
-public/stylesheets/tools.css
-public/stylesheets/pagination.css
-tmp/*
+log/*.log
tmp/**/*
-*.tmproj
-public/sitemaps/*
-config/initializers/hoptoad.rb
-config/newrelic.yml
-
-Gemfile.lock
-.bundle/config
-.bundle/environment.rb
View
22 .gitignore.rails2
@@ -0,0 +1,22 @@
+.DS_Store
+log/*.log
+tmp/**/*
+db/*.sqlite3
+config/database.yml
+coverage/*
+coverage.data
+*~
+public/stylesheets/application.css
+public/stylesheets/text.css
+public/stylesheets/tools.css
+public/stylesheets/pagination.css
+tmp/*
+tmp/**/*
+*.tmproj
+public/sitemaps/*
+config/initializers/hoptoad.rb
+config/newrelic.yml
+
+Gemfile.lock
+.bundle/config
+.bundle/environment.rb
View
2 .rvmrc
@@ -0,0 +1,2 @@
+rvm 1.8.7-p249@rails3upgrade
+
View
38 Gemfile
@@ -1,25 +1,25 @@
source "http://rubygems.org"
-gem "rails", "2.3.5"
+gem "rails", "3.0.0.beta4"
gem "mysql"
-gem "authlogic"
-gem "json"
-gem "ratom", :require => 'atom'
-gem "will_paginate"
-gem "haml"
-gem "newrelic_rpm"
-gem "big_sitemap", :git => 'http://github.com/alexrabarts/big_sitemap.git'
-gem "slim_scrooge"
+# gem "authlogic"
+# gem "json"
+# gem "ratom", :require => 'atom'
+# gem "will_paginate"
+# gem "haml"
+# gem "newrelic_rpm"
+# gem "big_sitemap", :git => 'http://github.com/alexrabarts/big_sitemap.git'
+# gem "slim_scrooge"
group :test do
- gem "rspec"
- gem "rspec-rails"
- gem "remarkable_rails"
- gem "cucumber"
- gem "cucumber-rails"
- gem "database_cleaner"
- gem "launchy"
- gem 'email_spec'
- gem 'webrat'
- gem "factory_girl"
+ # gem "rspec"
+ # gem "rspec-rails"
+ # gem "remarkable_rails"
+ # gem "cucumber"
+ # gem "cucumber-rails"
+ # gem "database_cleaner"
+ # gem "launchy"
+ # gem 'email_spec'
+ # gem 'webrat'
+ # gem "factory_girl"
end
View
65 Gemfile.lock
@@ -0,0 +1,65 @@
+---
+dependencies:
+ rails:
+ group:
+ - :default
+ version: = 3.0.0.beta4
+ mysql:
+ group:
+ - :default
+ version: ">= 0"
+specs:
+- rake:
+ version: 0.8.7
+- abstract:
+ version: 1.0.0
+- activesupport:
+ version: 3.0.0.beta4
+- builder:
+ version: 2.1.2
+- i18n:
+ version: 0.4.1
+- activemodel:
+ version: 3.0.0.beta4
+- erubis:
+ version: 2.6.6
+- rack:
+ version: 1.1.0
+- rack-mount:
+ version: 0.6.6
+- rack-test:
+ version: 0.5.4
+- tzinfo:
+ version: 0.3.22
+- actionpack:
+ version: 3.0.0.beta4
+- mime-types:
+ version: "1.16"
+- polyglot:
+ version: 0.3.1
+- treetop:
+ version: 1.4.8
+- mail:
+ version: 2.2.5
+- actionmailer:
+ version: 3.0.0.beta4
+- arel:
+ version: 0.4.0
+- activerecord:
+ version: 3.0.0.beta4
+- activeresource:
+ version: 3.0.0.beta4
+- bundler:
+ version: 0.9.26
+- mysql:
+ version: 2.8.1
+- thor:
+ version: 0.13.7
+- railties:
+ version: 3.0.0.beta4
+- rails:
+ version: 3.0.0.beta4
+hash: dbc402eca1d8b3bb14fa460912648d0e3652ab6d
+sources:
+- Rubygems:
+ uri: http://rubygems.org
View
281 README
@@ -0,0 +1,281 @@
+== Welcome to Rails
+
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
+
+This pattern splits the view (also called the presentation) into "dumb"
+templates that are primarily responsible for inserting pre-built data in between
+HTML tags. The model contains the "smart" domain objects (such as Account,
+Product, Person, Post) that holds all the business logic and knows how to
+persist themselves to a database. The controller handles the incoming requests
+(such as Save New Account, Update Product, Show Post) by manipulating the model
+and directing data to the view.
+
+In Rails, the model is handled by what's called an object-relational mapping
+layer entitled Active Record. This layer allows you to present the data from
+database rows as objects and embellish these data objects with business logic
+methods. You can read more about Active Record in
+link:files/vendor/rails/activerecord/README.html.
+
+The controller and view are handled by the Action Pack, which handles both
+layers by its two parts: Action View and Action Controller. These two layers
+are bundled in a single package due to their heavy interdependence. This is
+unlike the relationship between the Active Record and Action Pack that is much
+more separate. Each of these packages can be used independently outside of
+Rails. You can read more about Action Pack in
+link:files/vendor/rails/actionpack/README.html.
+
+
+== Getting Started
+
+1. At the command prompt, create a new Rails application:
+ <tt>rails myapp</tt> (where <tt>myapp</tt> is the application name)
+
+2. Change directory to <tt>myapp</tt> and start the web server:
+ <tt>cd myapp; rails server</tt> (run with --help for options)
+
+3. Go to http://localhost:3000/ and you'll see:
+ "Welcome aboard: You're riding the Rails!"
+
+4. Follow the guidelines to start developing your application. You can find
+the following resources handy:
+
+* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
+* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
+
+
+== Web Servers
+
+By default, Rails will try to use Mongrel if it's installed when started with
+<tt>rails server</tt>, otherwise Rails will use WEBrick, the web server that
+ships with Ruby.
+
+Mongrel is a Ruby-based web server with a C component (which requires
+compilation) that is suitable for development. If you have Ruby Gems installed,
+getting up and running with mongrel is as easy as:
+ <tt>sudo gem install mongrel</tt>.
+
+You can find more info at: http://mongrel.rubyforge.org
+
+You can alternatively run Rails applications with other Ruby web servers, e.g.,
+{Thin}[http://code.macournoyer.com/thin/], {Ebb}[http://ebb.rubyforge.org/], and
+Apache with {mod_rails}[http://www.modrails.com/]. However, <tt>rails server</tt>
+doesn't search for or start them.
+
+For production use, often a web/proxy server, e.g., {Apache}[http://apache.org],
+{Nginx}[http://nginx.net/], {LiteSpeed}[http://litespeedtech.com/],
+{Lighttpd}[http://www.lighttpd.net/], or {IIS}[http://www.iis.net/], is deployed
+as the front end server with the chosen Ruby web server running in the back end
+and receiving the proxied requests via one of several protocols (HTTP, CGI, FCGI).
+
+
+== Debugging Rails
+
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
+will help you debug it and get it back on the rails.
+
+First area to check is the application log files. Have "tail -f" commands
+running on the server.log and development.log. Rails will automatically display
+debugging and runtime information to these files. Debugging info will also be
+shown in the browser on requests from 127.0.0.1.
+
+You can also log your own messages directly into the log file from your code
+using the Ruby logger class from inside your controllers. Example:
+
+ class WeblogController < ActionController::Base
+ def destroy
+ @weblog = Weblog.find(params[:id])
+ @weblog.destroy
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
+ end
+ end
+
+The result will be a message in your log file along the lines of:
+
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
+
+More information on how to use the logger is at http://www.ruby-doc.org/core/
+
+Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
+several books available online as well:
+
+* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+
+These two books will bring you up to speed on the Ruby language and also on
+programming in general.
+
+
+== Debugger
+
+Debugger support is available through the debugger command when you start your
+Mongrel or WEBrick server with --debugger. This means that you can break out of
+execution at any point in the code, investigate and change the model, and then,
+resume execution! You need to install ruby-debug to run the server in debugging
+mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
+
+ class WeblogController < ActionController::Base
+ def index
+ @posts = Post.find(:all)
+ debugger
+ end
+ end
+
+So the controller will accept the action, run the first line, then present you
+with a IRB prompt in the server window. Here you can do things like:
+
+ >> @posts.inspect
+ => "[#<Post:0x14a6be8
+ @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
+ #<Post:0x14a6620
+ @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
+ >> @posts.first.title = "hello from a debugger"
+ => "hello from a debugger"
+
+...and even better, you can examine how your runtime objects actually work:
+
+ >> f = @posts.first
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+ >> f.
+ Display all 152 possibilities? (y or n)
+
+Finally, when you're ready to resume execution, you can enter "cont".
+
+
+== Console
+
+The console is a Ruby shell, which allows you to interact with your
+application's domain model. Here you'll have all parts of the application
+configured, just like it is when the application is running. You can inspect
+domain models, change values, and save to the database. Starting the script
+without arguments will launch it in the development environment.
+
+To start the console, run <tt>rails console</tt> from the application
+directory.
+
+Options:
+
+* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
+ made to the database.
+* Passing an environment name as an argument will load the corresponding
+ environment. Example: <tt>rails console production</tt>.
+
+To reload your controllers and models after launching the console run
+<tt>reload!</tt>
+
+More information about irb can be found at:
+link:http://www.rubycentral.com/pickaxe/irb.html
+
+
+== dbconsole
+
+You can go to the command line of your database directly through <tt>rails
+dbconsole</tt>. You would be connected to the database with the credentials
+defined in database.yml. Starting the script without arguments will connect you
+to the development database. Passing an argument will connect you to a different
+database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
+PostgreSQL and SQLite 3.
+
+== Description of Contents
+
+The default directory structure of a generated Ruby on Rails application:
+
+ |-- app
+ | |-- controllers
+ | |-- helpers
+ | |-- models
+ | `-- views
+ | `-- layouts
+ |-- config
+ | |-- environments
+ | |-- initializers
+ | `-- locales
+ |-- db
+ |-- doc
+ |-- lib
+ | `-- tasks
+ |-- log
+ |-- public
+ | |-- images
+ | |-- javascripts
+ | `-- stylesheets
+ |-- script
+ | `-- performance
+ |-- test
+ | |-- fixtures
+ | |-- functional
+ | |-- integration
+ | |-- performance
+ | `-- unit
+ |-- tmp
+ | |-- cache
+ | |-- pids
+ | |-- sessions
+ | `-- sockets
+ `-- vendor
+ `-- plugins
+
+app
+ Holds all the code that's specific to this particular application.
+
+app/controllers
+ Holds controllers that should be named like weblogs_controller.rb for
+ automated URL mapping. All controllers should descend from
+ ApplicationController which itself descends from ActionController::Base.
+
+app/models
+ Holds models that should be named like post.rb. Models descend from
+ ActiveRecord::Base by default.
+
+app/views
+ Holds the template files for the view that should be named like
+ weblogs/index.html.erb for the WeblogsController#index action. All views use
+ eRuby syntax by default.
+
+app/views/layouts
+ Holds the template files for layouts to be used with views. This models the
+ common header/footer method of wrapping views. In your views, define a layout
+ using the <tt>layout :default</tt> and create a file named default.html.erb.
+ Inside default.html.erb, call <% yield %> to render the view using this
+ layout.
+
+app/helpers
+ Holds view helpers that should be named like weblogs_helper.rb. These are
+ generated for you automatically when using generators for controllers.
+ Helpers can be used to wrap functionality for your views into methods.
+
+config
+ Configuration files for the Rails environment, the routing map, the database,
+ and other dependencies.
+
+db
+ Contains the database schema in schema.rb. db/migrate contains all the
+ sequence of Migrations for your schema.
+
+doc
+ This directory is where your application documentation will be stored when
+ generated using <tt>rake doc:app</tt>
+
+lib
+ Application specific libraries. Basically, any kind of custom code that
+ doesn't belong under controllers, models, or helpers. This directory is in
+ the load path.
+
+public
+ The directory available for the web server. Contains subdirectories for
+ images, stylesheets, and javascripts. Also contains the dispatchers and the
+ default HTML files. This should be set as the DOCUMENT_ROOT of your web
+ server.
+
+script
+ Helper scripts for automation and generation.
+
+test
+ Unit and functional tests along with fixtures. When using the rails generate
+ command, template test files will be generated for you and placed in this
+ directory.
+
+vendor
+ External libraries that the application depends on. Also includes the plugins
+ subdirectory. If the app has frozen rails, those gems also go here, under
+ vendor/rails/. This directory is in the load path.
View
7 Rakefile
@@ -1,10 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
+require File.expand_path('../config/application', __FILE__)
require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'tasks/rails'
+Rails::Application.load_tasks
View
48 app/controllers/application_controller.rb
@@ -1,46 +1,4 @@
class ApplicationController < ActionController::Base
- helper :all # include all helpers, all the time
- protect_from_forgery # See ActionController::RequestForgeryProtection for details
- helper_method :current_user
- # filter_parameter_logging :social_security_number, :password, :credit_card_number, :ssn
-
-
- private
- def current_user
- return @current_user if defined?(@current_user)
- @current_user = current_user_session && current_user_session.user
- end
-
- def current_user_session
- return @current_user_session if defined?(@current_user_session)
- @current_user_session = UserSession.find
- end
-
- def require_user
- unless current_user
- store_location
- flash[:notice] = "You must be logged in to access this page"
- redirect_to new_user_session_url
- return false
- end
- end
-
- def require_no_user
- if current_user
- store_location
- flash[:notice] = "You must be logged out to access this page"
- redirect_to account_url
- return false
- end
- end
-
- def store_location
- session[:return_to] = request.request_uri
- end
-
- def redirect_back_or_default(default)
- redirect_to(session[:return_to] || default)
- session[:return_to] = nil
- end
-
-end
+ protect_from_forgery
+ layout 'application'
+end
View
46 app/controllers/application_controller.rb.rails2
@@ -0,0 +1,46 @@
+class ApplicationController < ActionController::Base
+ helper :all # include all helpers, all the time
+ protect_from_forgery # See ActionController::RequestForgeryProtection for details
+ helper_method :current_user
+ # filter_parameter_logging :social_security_number, :password, :credit_card_number, :ssn
+
+
+ private
+ def current_user
+ return @current_user if defined?(@current_user)
+ @current_user = current_user_session && current_user_session.user
+ end
+
+ def current_user_session
+ return @current_user_session if defined?(@current_user_session)
+ @current_user_session = UserSession.find
+ end
+
+ def require_user
+ unless current_user
+ store_location
+ flash[:notice] = "You must be logged in to access this page"
+ redirect_to new_user_session_url
+ return false
+ end
+ end
+
+ def require_no_user
+ if current_user
+ store_location
+ flash[:notice] = "You must be logged out to access this page"
+ redirect_to account_url
+ return false
+ end
+ end
+
+ def store_location
+ session[:return_to] = request.request_uri
+ end
+
+ def redirect_back_or_default(default)
+ redirect_to(session[:return_to] || default)
+ session[:return_to] = nil
+ end
+
+end
View
1 app/helpers/application_helper.rb
@@ -1,3 +1,2 @@
-# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
View
3 app/helpers/application_helper.rb.rails2
@@ -0,0 +1,3 @@
+# Methods added to this helper will be available to all templates in the application.
+module ApplicationHelper
+end
View
4 config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Urlagg::Application
View
11 config/application.rb
@@ -0,0 +1,11 @@
+# Put this in config/application.rb
+require File.expand_path('../boot', __FILE__)
+# require 'open-uri'
+
+module Urlagg
+ class Application < Rails::Application
+ config.time_zone = 'UTC'
+ end
+end
+
+# FETCH_LOG = Logger.new(File.open(RAILS_ROOT + '/log/fetch.log', File::WRONLY | File::APPEND | File::CREAT))
View
137 config/boot.rb
@@ -1,124 +1,13 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- Rails::GemDependency.add_frozen_gem_path
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- require 'rubygems'
- min_version = '1.3.1'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-class Rails::Boot
- def run
- load_initializer
-
- Rails::Initializer.class_eval do
- def load_gems
- @bundler_loaded ||= Bundler.require :default, Rails.env
- end
- end
-
- Rails::Initializer.run(:set_load_path)
- end
-end
-
-# All that for this:
-Rails.boot!
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../../Gemfile', __FILE__)
+begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+end if File.exist?(gemfile)
View
23 config/database.yml
@@ -0,0 +1,23 @@
+development:
+ adapter: mysql
+ host: localhost
+ username: root
+ password: yagni
+ database: urlagg_development
+
+test: &TEST
+ adapter: mysql
+ host: localhost
+ username: root
+ password: yagni
+ database: urlagg_test
+
+production:
+ adapter: mysql
+ host: localhost
+ username: root
+ password:
+ database: urlagg
+
+cucumber:
+ <<: *TEST
View
23 config/database.yml.rails2
@@ -0,0 +1,23 @@
+development:
+ adapter: mysql
+ host: localhost
+ username: root
+ password: yagni
+ database: urlagg_development
+
+test: &TEST
+ adapter: mysql
+ host: localhost
+ username: root
+ password: yagni
+ database: urlagg_test
+
+production:
+ adapter: mysql
+ host: localhost
+ username: root
+ password:
+ database: urlagg
+
+cucumber:
+ <<: *TEST
View
18 config/environment.rb
@@ -1,15 +1,5 @@
-# Be sure to restart your server when you modify this file
+# Load the rails application
+require File.expand_path('../application', __FILE__)
-# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-require 'open-uri'
-
-Rails::Initializer.run do |config|
- config.time_zone = 'UTC'
-end
-
-FETCH_LOG = Logger.new(File.open(RAILS_ROOT + '/log/fetch.log', File::WRONLY | File::APPEND | File::CREAT))
+# Initialize the rails application
+Urlagg::Application.initialize!
View
15 config/environment.rb.rails2
@@ -0,0 +1,15 @@
+# Be sure to restart your server when you modify this file
+
+# Specifies gem version of Rails to use when vendor/rails is not present
+RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
+
+# Bootstrap the Rails environment, frameworks, and default configuration
+require File.join(File.dirname(__FILE__), 'boot')
+
+require 'open-uri'
+
+Rails::Initializer.run do |config|
+ config.time_zone = 'UTC'
+end
+
+FETCH_LOG = Logger.new(File.open(RAILS_ROOT + '/log/fetch.log', File::WRONLY | File::APPEND | File::CREAT))
View
30 config/environments/development.rb
@@ -1,19 +1,19 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Urlagg::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
-# 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
+ # 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
+ # 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_view.debug_rjs = true
-config.action_controller.perform_caching = false
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_view.debug_rjs = true
+ config.action_controller.perform_caching = false
-# Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
-
-require "pp"
+ # Don't care if the mailer can't send
+ config.action_mailer.raise_delivery_errors = false
+end
View
19 config/environments/development.rb.rails2
@@ -0,0 +1,19 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# 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_view.debug_rjs = true
+config.action_controller.perform_caching = false
+
+# Don't care if the mailer can't send
+config.action_mailer.raise_delivery_errors = false
+
+require "pp"
View
58 config/environments/production.rb
@@ -1,28 +1,46 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Urlagg::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
-# The production environment is meant for finished, "live" apps.
-# Code is not reloaded between requests
-config.cache_classes = true
+ # The production environment is meant for finished, "live" apps.
+ # Code is not reloaded between requests
+ config.cache_classes = true
-# Full error reports are disabled and caching is turned on
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
-# See everything in the log (default is :info)
-# config.log_level = :debug
+ # Specifies the header that your server uses for sending files
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
-# Use a different logger for distributed setups
-# config.logger = SyslogLogger.new
+ # For nginx:
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
-# Use a different cache store in production
-# config.cache_store = :mem_cache_store
+ # If you have no front-end server that supports something like X-Sendfile,
+ # just comment this out and Rails will serve the files
-# Enable serving of images, stylesheets, and javascripts from an asset server
-# config.action_controller.asset_host = "http://assets.example.com"
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
-# Disable delivery errors, bad email addresses will be ignored
-# config.action_mailer.raise_delivery_errors = false
+ # Use a different logger for distributed setups
+ # config.logger = SyslogLogger.new
-# Enable threaded mode
-# config.threadsafe!
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Disable Rails's static asset server
+ # In production, Apache or nginx will already do this
+ config.serve_static_assets = false
+
+ # Enable serving of images, stylesheets, and javascripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+end
View
28 config/environments/production.rb.rails2
@@ -0,0 +1,28 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The production environment is meant for finished, "live" apps.
+# Code is not reloaded between requests
+config.cache_classes = true
+
+# Full error reports are disabled and caching is turned on
+config.action_controller.consider_all_requests_local = false
+config.action_controller.perform_caching = true
+config.action_view.cache_template_loading = true
+
+# See everything in the log (default is :info)
+# config.log_level = :debug
+
+# Use a different logger for distributed setups
+# config.logger = SyslogLogger.new
+
+# Use a different cache store in production
+# config.cache_store = :mem_cache_store
+
+# Enable serving of images, stylesheets, and javascripts from an asset server
+# config.action_controller.asset_host = "http://assets.example.com"
+
+# Disable delivery errors, bad email addresses will be ignored
+# config.action_mailer.raise_delivery_errors = false
+
+# Enable threaded mode
+# config.threadsafe!
View
28 config/environments/staging.rb.rails2
@@ -0,0 +1,28 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The production environment is meant for finished, "live" apps.
+# Code is not reloaded between requests
+config.cache_classes = true
+
+# Full error reports are disabled and caching is turned on
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching = true
+config.action_view.cache_template_loading = true
+
+# See everything in the log (default is :info)
+# config.log_level = :debug
+
+# Use a different logger for distributed setups
+# config.logger = SyslogLogger.new
+
+# Use a different cache store in production
+# config.cache_store = :mem_cache_store
+
+# Enable serving of images, stylesheets, and javascripts from an asset server
+# config.action_controller.asset_host = "http://assets.example.com"
+
+# Disable delivery errors, bad email addresses will be ignored
+# config.action_mailer.raise_delivery_errors = false
+
+# Enable threaded mode
+# config.threadsafe!
View
46 config/environments/test.rb
@@ -1,24 +1,32 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Urlagg::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
-# The test environment is used exclusively to run your application's
-# test suite. You never need to work with it otherwise. Remember that
-# your test database is "scratch space" for the test suite and is wiped
-# and recreated between test runs. Don't rely on the data there!
-config.cache_classes = true
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
+ # 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
-config.action_view.cache_template_loading = true
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
-# Disable request forgery protection in test environment
-config.action_controller.allow_forgery_protection = false
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
-# Tell Action Mailer not to deliver emails to the real world.
-# The :test delivery method accumulates sent emails in the
-# ActionMailer::Base.deliveries array.
-config.action_mailer.delivery_method = :test
-require "pp"
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+end
View
4 config/initializers/backtrace_silencers.rb
@@ -3,5 +3,5 @@
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
View
7 config/initializers/secret_token.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+Rails.application.config.secret_token = 'b80576b0bd95ca3bd1f816208718ab80ca917c85dfcc8105864ead3a8a037f1c37b6a4d440f1cb47cdc8b5fc61c1f5965f8244b6c9352e962a04d7915f433498'
View
11 config/initializers/session_store.rb
@@ -1,15 +1,8 @@
# Be sure to restart your server when you modify this file.
-# Your secret key for verifying cookie session data integrity.
-# If you change this key, all old sessions will become invalid!
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-ActionController::Base.session = {
- :key => '_urlagg_session',
- :secret => '4491bc0fa5cba65e002355833fed04a6395cd4412fe0f9bc8e1cc1501fb8cd9221c230c1853bb9adca1bb0014aac8ecfea96a5962582eac8d8caabe75f803991'
-}
+Rails.application.config.session_store :cookie_store, :key => '_urlagg_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
-# ActionController::Base.session_store = :active_record_store
+# Rails.application.config.session_store :active_record_store
View
2 config/locales/en.yml
@@ -2,4 +2,4 @@
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
- hello: "Hello world"
+ hello: "Hello world"
View
68 config/routes.rb
@@ -1,27 +1,45 @@
-ActionController::Routing::Routes.draw do |map|
- map.login 'login', :controller => "user_sessions", :action => "new"
- map.logout 'logout', :controller => "user_sessions", :action => "destroy", :method => :post
-
- map.connect '/tags/top', :controller => 'tags', :action => 'top'
- map.connect '/tags/:tag', :controller => 'tags', :action => 'show', :requirements => {:tag => /\D.+/}
- map.resources :tags, :member => { :summary => :get, :read => :post }, :collection => { :top => :get }
-
- map.resource :user_session
- map.resource :account
- map.resources :users, :member => { :summary => :get }
- map.resources :password_resets
- map.resources :taggings
-
- map.connect 'pages/:id', :controller => 'pages', :action => 'show'
- map.namespace :admin do |admin|
- admin.dashboard 'dashboard', :controller => 'dashboard'
- admin.login 'login', :controller => 'super_user_sessions', :action => "new"
- admin.logout 'logout', :controller => "super_user_sessions", :action => "destroy", :method => :post
- admin.resource :super_user_session
- admin.resources :links, :collection => { :reports => :get }
- admin.resources :tags
- admin.resources :users
+Urlagg::Application.routes.draw do
+ match 'login' => 'user_sessions#new', :as => :login
+ match 'logout' => 'user_sessions#destroy', :as => :logout, :method => post
+ match '/tags/top' => 'tags#top'
+ match '/tags/:tag' => 'tags#show', :constraints => { :tag => /\D.+/ }
+
+ resources :tags do
+ collection do
+ get :top
+ end
+ member do
+ get :summary
+ post :read
+ end
end
-
- map.root :controller => "pages", :action => "show", :index => 'index'
+
+ resource :user_session
+ resource :account
+ resources :users do
+
+ member do
+ get :summary
+ end
+
+ end
+
+ resources :password_resets
+ resources :taggings
+ match 'pages/:id' => 'pages#show'
+ namespace :admin do
+ match 'dashboard' => 'dashboard#index', :as => :dashboard
+ match 'login' => 'super_user_sessions#new', :as => :login
+ match 'logout' => 'super_user_sessions#destroy', :as => :logout, :method => post
+ resource :super_user_session
+ resources :links do
+ collection do
+ get :reports
+ end
+ end
+ resources :tags
+ resources :users
+ end
+
+ match '/' => 'pages#show', :index => 'index'
end
View
27 config/routes.rb.rails2
@@ -0,0 +1,27 @@
+ActionController::Routing::Routes.draw do |map|
+ map.login 'login', :controller => "user_sessions", :action => "new"
+ map.logout 'logout', :controller => "user_sessions", :action => "destroy", :method => :post
+
+ map.connect '/tags/top', :controller => 'tags', :action => 'top'
+ map.connect '/tags/:tag', :controller => 'tags', :action => 'show', :requirements => {:tag => /\D.+/}
+ map.resources :tags, :member => { :summary => :get, :read => :post }, :collection => { :top => :get }
+
+ map.resource :user_session
+ map.resource :account
+ map.resources :users, :member => { :summary => :get }
+ map.resources :password_resets
+ map.resources :taggings
+
+ map.connect 'pages/:id', :controller => 'pages', :action => 'show'
+ map.namespace :admin do |admin|
+ admin.dashboard 'dashboard', :controller => 'dashboard'
+ admin.login 'login', :controller => 'super_user_sessions', :action => "new"
+ admin.logout 'logout', :controller => "super_user_sessions", :action => "destroy", :method => :post
+ admin.resource :super_user_session
+ admin.resources :links, :collection => { :reports => :get }
+ admin.resources :tags
+ admin.resources :users
+ end
+
+ map.root :controller => "pages", :action => "show", :index => 'index'
+end
View
7 db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
+# Mayor.create(:name => 'Daley', :city => cities.first)
View
2 doc/README_FOR_APP.rails2
@@ -0,0 +1,2 @@
+Use this README file to introduce your application and point to useful places in the API for learning more.
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
105 doc/upgrade_notes.txt
@@ -0,0 +1,105 @@
+(in /Volumes/Master/jschoolcraft/code/urlagg)
+Deprecated ERb helper calls
+Block helpers that use concat (e.g., form_for) should use <%= instead of <%. The current form will continue to work for now, but you will get deprecation warnings since this form will go away in the future.
+More information: http://weblog.rubyonrails.org/
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/views/accounts/edit.html.erb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/views/accounts/new.html.erb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/views/admin/super_user_sessions/new.html.erb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/views/password_resets/edit.html.erb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/views/password_resets/new.html.erb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/views/tags/_sidebar.html.erb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/views/tags/index.html.erb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/views/user_sessions/new.html.erb
+
+Deprecated constant(s)
+Constants like RAILS_ENV, RAILS_ROOT, and RAILS_DEFAULT_LOGGER are now deprecated.
+More information: http://litanyagainstfear.com/blog/2010/02/03/the-rails-module/
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/lib/daemons/link_updater.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/lib/tasks/ci.rake
+ - /Volumes/Master/jschoolcraft/code/urlagg/lib/tasks/rcov.rake
+ - /Volumes/Master/jschoolcraft/code/urlagg/lib/tasks/rspec.rake
+
+Deprecated ActionMailer API
+You're using the old ActionMailer API to send e-mails in a controller, model, or observer.
+More information: http://lindsaar.net/2010/1/26/new-actionmailer-api-in-rails-3
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/user.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/controllers/password_resets_controller.rb
+
+Old ActionMailer class API
+You're using the old API in a mailer class.
+More information: http://lindsaar.net/2010/1/26/new-actionmailer-api-in-rails-3
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/notifier.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/notifier.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/notifier.rb
+
+Soon-to-be-deprecated ActiveRecord calls
+Methods such as find(:all), find(:first), finds with conditions, and the :joins option will soon be deprecated.
+More information: http://m.onkey.org/2010/1/22/active-record-query-interface
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/controllers/admin/links_controller.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/tag.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/user.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/tag.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/tag.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/user.rb
+
+named_scope is now just scope
+The named_scope method has been renamed to just scope.
+More information: http://github.com/rails/rails/commit/d60bb0a9e4be2ac0a9de9a69041a4ddc2e0cc914
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/link.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/tag.rb
+ - /Volumes/Master/jschoolcraft/code/urlagg/app/models/tagging.rb
+
+Deprecated session secret setting
+Previously, session secret was set directly on ActionController::Base; it's now config.secret_token.
+More information: http://lindsaar.net/2010/4/7/rails_3_session_secret_and_session_store
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/config/initializers/session_store.rb
+
+Old Rails generator API
+A plugin in the app is using the old generator API (a new one may be available at http://github.com/trydionel/rails3-generators).
+More information: http://blog.plataformatec.com.br/2010/01/discovering-rails-3-generators/
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/vendor/plugins/daemon_generator/generators/
+ - /Volumes/Master/jschoolcraft/code/urlagg/vendor/plugins/daemon_generator/generators/daemon/
+ - /Volumes/Master/jschoolcraft/code/urlagg/vendor/plugins/daemon_generator/generators/daemon/templates/
+ - /Volumes/Master/jschoolcraft/code/urlagg/vendor/plugins/resource_controller/generators/
+ - /Volumes/Master/jschoolcraft/code/urlagg/vendor/plugins/resource_controller/generators/scaffold_resource/
+ - /Volumes/Master/jschoolcraft/code/urlagg/vendor/plugins/resource_controller/generators/scaffold_resource/templates/
+ - /Volumes/Master/jschoolcraft/code/urlagg/vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/
+ - /Volumes/Master/jschoolcraft/code/urlagg/vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/
+
+Old session store setting
+Previously, session store was set directly on ActionController::Base; it's now config.session_store :whatever.
+More information: http://lindsaar.net/2010/4/7/rails_3_session_secret_and_session_store
+
+The culprits:
+ - /Volumes/Master/jschoolcraft/code/urlagg/config/initializers/session_store.rb
+
+Old router API
+The router API has totally changed.
+More information: http://yehudakatz.com/2009/12/26/the-rails-3-router-rack-it-up/
+
+The culprits:
+ - config/routes.rb
+
+New file needed: config/application.rb
+You need to add a config/application.rb.
+More information: http://omgbloglol.com/post/353978923/the-path-to-rails-3-approaching-the-upgrade
+
+The culprits:
+ - config/application.rb
+
View
0 lib/tasks/.gitkeep
No changes.
View
34 public/404.html
@@ -1,23 +1,19 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>The page you were looking for doesn't exist (404)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
</head>
<body>
@@ -27,4 +23,4 @@
<p>You may have mistyped the address or the page may have moved.</p>
</div>
</body>
-</html>
+</html>
View
34 public/422.html
@@ -1,23 +1,19 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>The change you wanted was rejected (422)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
</head>
<body>
@@ -27,4 +23,4 @@
<p>Maybe you tried to change something you didn't have access to.</p>
</div>
</body>
-</html>
+</html>
View
32 public/500.html
@@ -1,23 +1,19 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
+<!DOCTYPE html>
+<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>We're sorry, but something went wrong (500)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
</head>
<body>
View
BIN public/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
279 public/index.html
@@ -0,0 +1,279 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Ruby on Rails: Welcome aboard</title>
+ <style type="text/css" media="screen">
+ body {
+ margin: 0;
+ margin-bottom: 25px;
+ padding: 0;
+ background-color: #f0f0f0;
+ font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
+ font-size: 13px;
+ color: #333;
+ }
+
+ h1 {
+ font-size: 28px;
+ color: #000;
+ }
+
+ a {color: #03c}
+ a:hover {
+ background-color: #03c;
+ color: white;
+ text-decoration: none;
+ }
+
+
+ #page {
+ background-color: #f0f0f0;
+ width: 750px;
+ margin: 0;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+ #content {
+ float: left;
+ background-color: white;
+ border: 3px solid #aaa;
+ border-top: none;
+ padding: 25px;
+ width: 500px;
+ }
+
+ #sidebar {
+ float: right;
+ width: 175px;
+ }
+
+ #footer {
+ clear: both;
+ }
+
+
+ #header, #about, #getting-started {
+ padding-left: 75px;
+ padding-right: 30px;
+ }
+
+
+ #header {
+ background-image: url("images/rails.png");
+ background-repeat: no-repeat;
+ background-position: top left;
+ height: 64px;
+ }
+ #header h1, #header h2 {margin: 0}
+ #header h2 {
+ color: #888;
+ font-weight: normal;
+ font-size: 16px;
+ }
+
+
+ #about h3 {
+ margin: 0;
+ margin-bottom: 10px;
+ font-size: 14px;
+ }
+
+ #about-content {
+ background-color: #ffd;
+ border: 1px solid #fc0;
+ margin-left: -55px;
+ margin-right: -10px;
+ }
+ #about-content table {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size: 11px;
+ border-collapse: collapse;
+ }
+ #about-content td {
+ padding: 10px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ }
+ #about-content td.name {color: #555}
+ #about-content td.value {color: #000}
+
+ #about-content ul {
+ padding: 0;
+ list-style-type: none;
+ }
+
+ #about-content.failure {
+ background-color: #fcc;
+ border: 1px solid #f00;
+ }
+ #about-content.failure p {
+ margin: 0;
+ padding: 10px;
+ }
+
+
+ #getting-started {
+ border-top: 1px solid #ccc;
+ margin-top: 25px;
+ padding-top: 15px;
+ }
+ #getting-started h1 {
+ margin: 0;
+ font-size: 20px;
+ }
+ #getting-started h2 {
+ margin: 0;
+ font-size: 14px;
+ font-weight: normal;
+ color: #333;
+ margin-bottom: 25px;
+ }
+ #getting-started ol {
+ margin-left: 0;
+ padding-left: 0;
+ }
+ #getting-started li {
+ font-size: 18px;
+ color: #888;
+ margin-bottom: 25px;
+ }
+ #getting-started li h2 {
+ margin: 0;
+ font-weight: normal;
+ font-size: 18px;
+ color: #333;
+ }
+ #getting-started li p {
+ color: #555;
+ font-size: 13px;
+ }
+
+
+ #search {
+ margin: 0;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ font-size: 11px;
+ }
+ #search input {
+ font-size: 11px;
+ margin: 2px;
+ }
+ #search-text {width: 170px}
+
+
+ #sidebar ul {
+ margin-left: 0;
+ padding-left: 0;
+ }
+ #sidebar ul h3 {
+ margin-top: 25px;
+ font-size: 16px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #ccc;
+ }
+ #sidebar li {
+ list-style-type: none;
+ }
+ #sidebar ul.links li {
+ margin-bottom: 5px;
+ }
+
+ </style>
+ <script type="text/javascript">
+ function about() {
+ info = document.getElementById('about-content');
+ if (window.XMLHttpRequest)
+ { xhr = new XMLHttpRequest(); }
+ else
+ { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
+ xhr.open("GET","rails/info/properties",false);
+ xhr.send("");
+ info.innerHTML = xhr.responseText;
+ info.style.display = 'block'
+ }
+
+ function prepend() {
+ search = document.getElementById('search-text');
+ text = search.value;
+ search.value = 'site:rubyonrails.org ' + text;
+ }
+
+ window.onload = function() {
+ document.getElementById('search-text').value = '';
+ }
+ </script>
+ </head>
+ <body>
+ <div id="page">
+ <div id="sidebar">
+ <ul id="sidebar-items">
+ <li>
+ <form id="search" action="http://www.google.com/search" method="get" onSubmit="prepend();">
+ <input type="hidden" name="hl" value="en" />
+ <input type="text" id="search-text" name="q" value="site:rubyonrails.org " />
+ <input type="submit" value="Search" /> the Rails site
+ </form>
+ </li>
+
+ <li>
+ <h3>Join the community</h3>
+ <ul class="links">
+ <li><a href="http://www.rubyonrails.org/">Ruby on Rails</a></li>
+ <li><a href="http://weblog.rubyonrails.org/">Official weblog</a></li>
+ <li><a href="http://wiki.rubyonrails.org/">Wiki</a></li>
+ </ul>
+ </li>
+
+ <li>
+ <h3>Browse the documentation</h3>
+ <ul class="links">
+ <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
+ <li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
+ <li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
+ <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+
+ <div id="content">
+ <div id="header">
+ <h1>Welcome aboard</h1>
+ <h2>You&rsquo;re riding Ruby on Rails!</h2>
+ </div>
+
+ <div id="about">
+ <h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
+ <div id="about-content" style="display: none"></div>
+ </div>
+
+ <div id="getting-started">
+ <h1>Getting started</h1>
+ <h2>Here&rsquo;s how to get rolling:</h2>
+
+ <ol>
+ <li>
+ <h2>Use <code>rails generate</code> to create your models and controllers</h2>
+ <p>To see all available options, run it without parameters.</p>
+ </li>
+
+ <li>
+ <h2>Set up a default route and remove or rename this file</h2>
+ <p>Routes are set up in config/routes.rb.</p>
+ </li>
+
+ <li>
+ <h2>Create your database</h2>
+ <p>Run <code>rake db:migrate</code> to create your database. If you're not using SQLite (the default), edit <code>config/database.yml</code> with your username and password.</p>
+ </li>
+ </ol>
+ </div>
+ </div>
+
+ <div id="footer">&nbsp;</div>
+ </div>
+ </body>
+</html>
View
965 public/javascripts/controls.js
@@ -0,0 +1,965 @@
+// script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
+
+// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
+// (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
+// Contributors:
+// Richard Livsey
+// Rahul Bhargava
+// Rob Wills
+//
+// script.aculo.us is freely distributable under the terms of an MIT-style license.
+// For details, see the script.aculo.us web site: http://script.aculo.us/
+
+// Autocompleter.Base handles all the autocompletion functionality
+// that's independent of the data source for autocompletion. This
+// includes drawing the autocompletion menu, observing keyboard
+// and mouse events, and similar.
+//
+// Specific autocompleters need to provide, at the very least,
+// a getUpdatedChoices function that will be invoked every time
+// the text inside the monitored textbox changes. This method
+// should get the text for which to provide autocompletion by
+// invoking this.getToken(), NOT by directly accessing
+// this.element.value. This is to allow incremental tokenized
+// autocompletion. Specific auto-completion logic (AJAX, etc)
+// belongs in getUpdatedChoices.
+//
+// Tokenized incremental autocompletion is enabled automatically
+// when an autocompleter is instantiated with the 'tokens' option
+// in the options parameter, e.g.:
+// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
+// will incrementally autocomplete with a comma as the token.
+// Additionally, ',' in the above example can be replaced with
+// a token array, e.g. { tokens: [',', '\n'] } which
+// enables autocompletion on multiple tokens. This is most
+// useful when one of the tokens is \n (a newline), as it
+// allows smart autocompletion after linebreaks.
+
+if(typeof Effect == 'undefined')
+ throw("controls.js requires including script.aculo.us' effects.js library");
+
+var Autocompleter = { };
+Autocompleter.Base = Class.create({
+ baseInitialize: function(element, update, options) {
+ element = $(element);
+ this.element = element;
+ this.update = $(update);
+ this.hasFocus = false;
+ this.changed = false;
+ this.active = false;
+ this.index = 0;
+ this.entryCount = 0;
+ this.oldElementValue = this.element.value;
+
+ if(this.setOptions)
+ this.setOptions(options);
+ else
+ this.options = options || { };
+
+ this.options.paramName = this.options.paramName || this.element.name;
+ this.options.tokens = this.options.tokens || [];
+ this.options.frequency = this.options.frequency || 0.4;
+ this.options.minChars = this.options.minChars || 1;
+ this.options.onShow = this.options.onShow ||
+ function(element, update){
+ if(!update.style.position || update.style.position=='absolute') {
+ update.style.position = 'absolute';
+ Position.clone(element, update, {
+ setHeight: false,
+ offsetTop: element.offsetHeight
+ });
+ }
+ Effect.Appear(update,{duration:0.15});
+ };
+ this.options.onHide = this.options.onHide ||
+ function(element, update){ new Effect.Fade(update,{duration:0.15}) };
+
+ if(typeof(this.options.tokens) == 'string')
+ this.options.tokens = new Array(this.options.tokens);
+ // Force carriage returns as token delimiters anyway
+ if (!this.options.tokens.include('\n'))
+ this.options.tokens.push('\n');
+
+ this.observer = null;
+
+ this.element.setAttribute('autocomplete','off');
+
+ Element.hide(this.update);
+
+ Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
+ Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
+ },
+
+ show: function() {
+ if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
+ if(!this.iefix &&
+ (Prototype.Browser.IE) &&
+ (Element.getStyle(this.update, 'position')=='absolute')) {
+ new Insertion.After(this.update,
+ '<iframe id="' + this.update.id + '_iefix" '+
+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
+ 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
+ this.iefix = $(this.update.id+'_iefix');
+ }
+ if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
+ },
+
+ fixIEOverlapping: function() {
+ Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
+ this.iefix.style.zIndex = 1;
+ this.update.style.zIndex = 2;
+ Element.show(this.iefix);
+ },
+
+ hide: function() {
+ this.stopIndicator();
+ if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
+ if(this.iefix) Element.hide(this.iefix);
+ },
+
+ startIndicator: function() {
+ if(this.options.indicator) Element.show(this.options.indicator);
+ },
+
+ stopIndicator: function() {
+ if(this.options.indicator) Element.hide(this.options.indicator);
+ },
+
+ onKeyPress: function(event) {
+ if(this.active)
+ switch(event.keyCode) {
+ case Event.KEY_TAB:
+ case Event.KEY_RETURN:
+ this.selectEntry();
+ Event.stop(event);
+ case Event.KEY_ESC:
+ this.hide();
+ this.active = false;
+ Event.stop(event);
+ return;
+ case Event.KEY_LEFT:
+ case Event.KEY_RIGHT:
+ return;
+ case Event.KEY_UP:
+ this.markPrevious();
+ this.render();
+ Event.stop(event);
+ return;
+ case Event.KEY_DOWN:
+ this.markNext();
+ this.render();
+ Event.stop(event);
+ return;
+ }
+ else
+ if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
+ (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
+
+ this.changed = true;
+ this.hasFocus = true;
+
+ if(this.observer) clearTimeout(this.observer);
+ this.observer =
+ setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
+ },
+
+ activate: function() {
+ this.changed = false;
+ this.hasFocus = true;
+ this.getUpdatedChoices();
+ },
+
+ onHover: function(event) {
+ var element = Event.findElement(event, 'LI');
+ if(this.index != element.autocompleteIndex)
+ {
+ this.index = element.autocompleteIndex;
+ this.render();
+ }
+ Event.stop(event);
+ },
+
+ onClick: function(event) {
+ var element = Event.findElement(event, 'LI');
+ this.index = element.autocompleteIndex;
+ this.selectEntry();
+ this.hide();
+ },
+
+ onBlur: function(event) {
+ // needed to make click events working
+ setTimeout(this.hide.bind(this), 250);
+ this.hasFocus = false;
+ this.active = false;
+ },
+
+ render: function() {
+ if(this.entryCount > 0) {
+ for (var i = 0; i < this.entryCount; i++)
+ this.index==i ?
+ Element.addClassName(this.getEntry(i),"selected") :
+ Element.removeClassName(this.getEntry(i),"selected");
+ if(this.hasFocus) {
+ this.show();
+ this.active = true;
+ }
+ } else {
+ this.active = false;
+ this.hide();
+ }
+ },
+
+ markPrevious: function() {
+ if(this.index > 0) this.index--;
+ else this.index = this.entryCount-1;
+ this.getEntry(this.index).scrollIntoView(true);
+ },
+
+ markNext: function() {
+ if(this.index < this.entryCount-1) this.index++;
+ else this.index = 0;
+ this.getEntry(this.index).scrollIntoView(false);
+ },
+
+ getEntry: function(index) {
+ return this.update.firstChild.childNodes[index];
+ },
+
+ getCurrentEntry: function() {
+ return this.getEntry(this.index);
+ },
+
+ selectEntry: function() {
+ this.active = false;
+ this.updateElement(this.getCurrentEntry());
+ },
+
+ updateElement: function(selectedElement) {
+ if (this.options.updateElement) {
+ this.options.updateElement(selectedElement);
+ return;
+ }
+ var value = '';
+ if (this.options.select) {
+ var nodes = $(selectedElement).select('.' + this.options.select) || [];
+ if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
+ } else
+ value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
+
+ var bounds = this.getTokenBounds();
+ if (bounds[0] != -1) {
+ var newValue = this.element.value.substr(0, bounds[0]);
+ var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
+ if (whitespace)
+ newValue += whitespace[0];
+ this.element.value = newValue + value + this.element.value.substr(bounds[1]);
+ } else {
+ this.element.value = value;
+ }
+ this.oldElementValue = this.element.value;
+ this.element.focus();
+
+ if (this.options.afterUpdateElement)
+ this.options.afterUpdateElement(this.element, selectedElement);
+ },
+
+ updateChoices: function(choices) {
+ if(!this.changed && this.hasFocus) {
+ this.update.innerHTML = choices;
+ Element.cleanWhitespace(this.update);
+ Element.cleanWhitespace(this.update.down());
+
+ if(this.update.firstChild && this.update.down().childNodes) {
+ this.entryCount =
+ this.update.down().childNodes.length;
+ for (var i = 0; i < this.entryCount; i++) {
+ var entry = this.getEntry(i);
+ entry.autocompleteIndex = i;
+ this.addObservers(entry);
+ }
+ } else {
+ this.entryCount = 0;
+ }
+
+ this.stopIndicator();
+ this.index = 0;
+
+ if(this.entryCount==1 && this.options.autoSelect) {
+ this.selectEntry();
+ this.hide();
+ } else {
+ this.render();
+ }
+ }
+ },
+
+ addObservers: function(element) {
+ Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
+ Event.observe(element, "click", this.onClick.bindAsEventListener(this));
+ },
+
+ onObserverEvent: function() {
+ this.changed = false;
+ this.tokenBounds = null;
+ if(this.getToken().length>=this.options.minChars) {
+ this.getUpdatedChoices();
+ } else {
+ this.active = false;
+ this.hide();
+ }
+ this.oldElementValue = this.element.value;
+ },
+
+ getToken: function() {
+ var bounds = this.getTokenBounds();
+ return this.element.value.substring(bounds[0], bounds[1]).strip();
+ },
+
+ getTokenBounds: function() {
+ if (null != this.tokenBounds) return this.tokenBounds;
+ var value = this.element.value;
+ if (value.strip().empty()) return [-1, 0];
+ var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
+ var offset = (diff == this.oldElementValue.length ? 1 : 0);
+ var prevTokenPos = -1, nextTokenPos = value.length;
+ var tp;
+ for (var index = 0, l = this.options.tokens.length; index < l; ++index) {
+ tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
+ if (tp > prevTokenPos) prevTokenPos = tp;
+ tp = value.indexOf(this.options.tokens[index], diff + offset);
+ if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
+ }
+ return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
+ }
+});
+
+Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) {
+ var boundary = Math.min(newS.length, oldS.length);
+ for (var index = 0; index < boundary; ++index)
+ if (newS[index] != oldS[index])
+ return index;
+ return boundary;
+};
+
+Ajax.Autocompleter = Class.create(Autocompleter.Base, {
+ initialize: function(element, update, url, options) {
+ this.baseInitialize(element, update, options);
+ this.options.asynchronous = true;
+ this.options.onComplete = this.onComplete.bind(this);
+ this.options.defaultParams = this.options.parameters || null;
+ this.url = url;
+ },
+
+ getUpdatedChoices: function() {
+ this.startIndicator();
+
+ var entry = encodeURIComponent(this.options.paramName) + '=' +
+ encodeURIComponent(this.getToken());
+
+ this.options.parameters = this.options.callback ?
+ this.options.callback(this.element, entry) : entry;
+
+ if(this.options.defaultParams)
+ this.options.parameters += '&' + this.options.defaultParams;
+
+ new Ajax.Request(this.url, this.options);
+ },
+
+ onComplete: function(request) {
+ this.updateChoices(request.responseText);
+ }
+});
+
+// The local array autocompleter. Used when you'd prefer to
+// inject an array of autocompletion options into the page, rather
+// than sending out Ajax queries, which can be quite slow sometimes.
+//
+// The constructor takes four parameters. The first two are, as usual,
+// the id of the monitored textbox, and id of the autocompletion menu.
+// The third is the array you want to autocomplete from, and the fourth
+// is the options block.
+//
+// Extra local autocompletion options:
+// - choices - How many autocompletion choices to offer
+//
+// - partialSearch - If false, the autocompleter will match entered
+// text only at the beginning of strings in the
+// autocomplete array. Defaults to true, which will
+// match text at the beginning of any *word* in the
+// strings in the autocomplete array. If you want to
+// search anywhere in the string, additionally set
+// the option fullSearch to true (default: off).
+//
+// - fullSsearch - Search anywhere in autocomplete array strings.
+//
+// - partialChars - How many characters to enter before triggering
+// a partial match (unlike minChars, which defines
+// how many characters are required to do any match
+// at all). Defaults to 2.
+//
+// - ignoreCase - Whether to ignore case when autocompleting.
+// Defaults to true.
+//
+// It's possible to pass in a custom function as the 'selector'
+// option, if you prefer to write your own autocompletion logic.
+// In that case, the other options above will not apply unless
+// you support them.
+
+Autocompleter.Local = Class.create(Autocompleter.Base, {
+ initialize: function(element, update, array, options) {
+ this.baseInitialize(element, update, options);
+ this.options.array = array;
+ },
+
+ getUpdatedChoices: function() {
+ this.updateChoices(this.options.selector(this));