Permalink
Browse files

Upgrade to Rails 3 by replacing default Rails generated files where a…

…pplicable and modifying as needed. Also upgrade gems and plugins.
  • Loading branch information...
1 parent aa3ff03 commit 3f111df2c93e81d16501702bb9111da011d97202 @jasoncheow jasoncheow committed Nov 13, 2010
Showing with 1,127 additions and 3,735 deletions.
  1. +39 −4 Gemfile
  2. +130 −0 Gemfile.lock
  3. +2 −7 Rakefile
  4. +4 −0 config.ru
  5. +42 −0 config/application.rb
  6. +13 −110 config/boot.rb
  7. +5 −2 config/database.example.yml
  8. +4 −42 config/environment.rb
  9. +22 −13 config/environments/development.rb
  10. +44 −13 config/environments/production.rb
  11. +35 −29 config/environments/test.rb
  12. +2 −2 config/initializers/backtrace_silencers.rb
  13. +4 −1 config/initializers/exception_notifier.rb
  14. +1 −1 config/initializers/inflections.rb
  15. +7 −0 config/initializers/secret_token.rb
  16. +2 −9 config/initializers/session_store.rb
  17. +5 −0 config/locales/en.yml
  18. +7 −0 db/seeds.rb
  19. +15 −19 public/404.html
  20. +15 −19 public/422.html
  21. +15 −19 public/500.html
  22. BIN public/images/rails.png
  23. +0 −2 public/javascripts/application.js
  24. +0 −3 script/about
  25. +0 −3 script/autospec
  26. +0 −3 script/console
  27. +0 −3 script/dbconsole
  28. +0 −3 script/destroy
  29. +0 −3 script/generate
  30. +0 −3 script/performance/benchmarker
  31. +0 −3 script/performance/profiler
  32. +0 −3 script/performance/request
  33. +0 −3 script/plugin
  34. +0 −3 script/process/inspector
  35. +0 −3 script/process/reaper
  36. +0 −3 script/process/spawner
  37. +6 −0 script/rails
  38. +0 −3 script/runner
  39. +0 −3 script/server
  40. +0 −4 script/spec
  41. +0 −116 script/spec_server
  42. +27 −57 vendor/plugins/exception_notification/README
  43. +11 −0 vendor/plugins/exception_notification/exception_notification.gemspec
  44. +0 −1 vendor/plugins/exception_notification/init.rb
  45. +0 −99 vendor/plugins/exception_notification/lib/exception_notifiable.rb
  46. +24 −59 vendor/plugins/exception_notification/lib/exception_notifier.rb
  47. +83 −0 vendor/plugins/exception_notification/lib/exception_notifier/notifier.rb
  48. +1 −0 ...lugins/exception_notification/lib/exception_notifier/views/exception_notifier/_backtrace.text.erb
  49. +8 −0 ...gins/exception_notification/lib/exception_notifier/views/exception_notifier/_environment.text.erb
  50. +4 −0 .../plugins/exception_notification/lib/exception_notifier/views/exception_notifier/_request.text.erb
  51. +2 −0 .../plugins/exception_notification/lib/exception_notifier/views/exception_notifier/_session.text.erb
  52. +1 −1 ...xception_notifier/_title.rhtml → lib/exception_notifier/views/exception_notifier/_title.text.erb}
  53. +13 −0 ...tion_notification/lib/exception_notifier/views/exception_notifier/exception_notification.text.erb
  54. +0 −78 vendor/plugins/exception_notification/lib/exception_notifier_helper.rb
  55. +0 −61 vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb
  56. +0 −7 vendor/plugins/exception_notification/test/test_helper.rb
  57. +0 −1 vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml
  58. +0 −7 vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml
  59. +0 −16 vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml
  60. +0 −4 vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml
  61. +0 −2 vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml
  62. +0 −6 vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml
  63. +0 −2 vendor/plugins/formtastic/.gitignore
  64. +0 −224 vendor/plugins/formtastic/README.textile
  65. +0 −34 vendor/plugins/formtastic/Rakefile
  66. +0 −21 vendor/plugins/formtastic/generators/formtastic_stylesheets/formtastic_stylesheets_generator.rb
  67. +0 −136 vendor/plugins/formtastic/generators/formtastic_stylesheets/templates/formtastic.css
  68. +0 −10 vendor/plugins/formtastic/generators/formtastic_stylesheets/templates/formtastic_changes.css
  69. +0 −2 vendor/plugins/formtastic/init.rb
  70. +0 −1 vendor/plugins/formtastic/install.rb
  71. +0 −553 vendor/plugins/formtastic/lib/justin_french/formtastic.rb
  72. +0 −1,133 vendor/plugins/formtastic/spec/formtastic_spec.rb
  73. +0 −14 vendor/plugins/formtastic/spec/test_helper.rb
  74. +0 −1 vendor/plugins/formtastic/tasks/formtastic_tasks.rake
  75. +0 −1 vendor/plugins/formtastic/uninstall.rb
  76. +2 −0 vendor/plugins/open_id_authentication/CHANGELOG
  77. +9 −17 vendor/plugins/open_id_authentication/README
  78. +0 −11 ...uthentication/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb
  79. +0 −20 ...or/plugins/open_id_authentication/generators/open_id_authentication_tables/templates/migration.rb
  80. +0 −26 ...ns/open_id_authentication/generators/upgrade_open_id_authentication_tables/templates/migration.rb
  81. +0 −11 ...nerators/upgrade_open_id_authentication_tables/upgrade_open_id_authentication_tables_generator.rb
  82. +7 −13 vendor/plugins/open_id_authentication/init.rb
  83. +54 −169 vendor/plugins/open_id_authentication/lib/open_id_authentication.rb
  84. +0 −9 vendor/plugins/open_id_authentication/lib/open_id_authentication/association.rb
  85. +0 −55 vendor/plugins/open_id_authentication/lib/open_id_authentication/db_store.rb
  86. +0 −73 vendor/plugins/open_id_authentication/lib/open_id_authentication/mem_cache_store.rb
  87. +0 −5 vendor/plugins/open_id_authentication/lib/open_id_authentication/nonce.rb
  88. +0 −23 vendor/plugins/open_id_authentication/lib/open_id_authentication/request.rb
  89. +0 −20 vendor/plugins/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb
  90. +0 −30 vendor/plugins/open_id_authentication/tasks/open_id_authentication_tasks.rake
  91. +0 −151 vendor/plugins/open_id_authentication/test/mem_cache_store_test.rb
  92. +0 −32 vendor/plugins/open_id_authentication/test/normalize_test.rb
  93. +0 −46 vendor/plugins/open_id_authentication/test/open_id_authentication_test.rb
  94. +0 −14 vendor/plugins/open_id_authentication/test/status_test.rb
  95. +0 −17 vendor/plugins/open_id_authentication/test/test_helper.rb
  96. +1 −1 vendor/plugins/{formtastic → verification}/MIT-LICENSE
  97. +34 −0 vendor/plugins/verification/README
  98. +4 −4 vendor/plugins/{open_id_authentication → verification}/Rakefile
  99. +3 −0 vendor/plugins/verification/init.rb
  100. +132 −0 vendor/plugins/verification/lib/action_controller/verification.rb
  101. +18 −0 vendor/plugins/verification/test/test_helper.rb
  102. +270 −0 vendor/plugins/verification/test/verification_test.rb
View
43 Gemfile
@@ -1,5 +1,40 @@
-source :rubygems
+source 'http://rubygems.org'
+
+gem 'rails', '3.0.1'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+# gem 'mysql2'
+gem 'sqlite3-ruby', :require => 'sqlite3'
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug'
+
+# Bundle the extra gems:
+gem 'RedCloth', :require => 'redcloth'
+gem 'ruby-openid', :require => 'openid'
+gem 'rack-openid', :require => 'rack/openid'
gem 'chronic'
-gem 'coderay', '0.8.357'
-gem 'lesstile', '0.3.0'
-gem 'will_paginate', '2.3.12'
+gem 'coderay'
+gem 'lesstile'
+gem 'formtastic'
+gem 'will_paginate', '~> 3.0.pre3'
+
+# Bundle gems for the local environment. Make sure to
+# put test-only gems in this group so their generators
+# and rake tasks are available in development mode:
+group :development, :test do
+ gem 'cucumber'
+ gem 'webrat'
+ gem 'factory_girl'
+ gem 'rspec'
+ gem 'rspec-rails'
+ gem 'xml-simple', :require => 'xmlsimple'
+end
View
@@ -0,0 +1,130 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ RedCloth (4.2.3)
+ abstract (1.0.0)
+ actionmailer (3.0.1)
+ actionpack (= 3.0.1)
+ mail (~> 2.2.5)
+ actionpack (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4.1)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.12)
+ rack-test (~> 0.5.4)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.1)
+ activesupport (= 3.0.1)
+ builder (~> 2.1.2)
+ i18n (~> 0.4.1)
+ activerecord (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ arel (~> 1.0.0)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ activesupport (3.0.1)
+ arel (1.0.1)
+ activesupport (~> 3.0.0)
+ builder (2.1.2)
+ chronic (0.3.0)
+ coderay (0.9.5)
+ cucumber (0.9.4)
+ builder (~> 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.2.9)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ factory_girl (1.3.2)
+ formtastic (1.1.0)
+ actionpack (>= 2.3.0)
+ activesupport (>= 2.3.0)
+ i18n (>= 0.4.0)
+ gherkin (2.2.9)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ i18n (0.4.2)
+ json (1.4.6)
+ lesstile (1.0.0)
+ mail (2.2.9)
+ activesupport (>= 2.3.6)
+ i18n (~> 0.4.1)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ nokogiri (1.4.3.1)
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-openid (1.2.0)
+ rack (>= 1.1.0)
+ ruby-openid (>= 2.1.8)
+ rack-test (0.5.6)
+ rack (>= 1.0)
+ rails (3.0.1)
+ actionmailer (= 3.0.1)
+ actionpack (= 3.0.1)
+ activerecord (= 3.0.1)
+ activeresource (= 3.0.1)
+ activesupport (= 3.0.1)
+ bundler (~> 1.0.0)
+ railties (= 3.0.1)
+ railties (3.0.1)
+ actionpack (= 3.0.1)
+ activesupport (= 3.0.1)
+ rake (>= 0.8.4)
+ thor (~> 0.14.0)
+ rake (0.8.7)
+ rspec (2.1.0)
+ rspec-core (~> 2.1.0)
+ rspec-expectations (~> 2.1.0)
+ rspec-mocks (~> 2.1.0)
+ rspec-core (2.1.0)
+ rspec-expectations (2.1.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.1.0)
+ rspec-rails (2.1.0)
+ rspec (~> 2.1.0)
+ ruby-openid (2.1.8)
+ sqlite3-ruby (1.3.2)
+ term-ansicolor (1.0.5)
+ thor (0.14.4)
+ treetop (1.4.8)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.23)
+ webrat (0.7.2)
+ nokogiri (>= 1.2.0)
+ rack (>= 1.0)
+ rack-test (>= 0.5.3)
+ will_paginate (3.0.pre2)
+ xml-simple (1.0.12)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ RedCloth
+ chronic
+ coderay
+ cucumber
+ factory_girl
+ formtastic
+ lesstile
+ rack-openid
+ rails (= 3.0.1)
+ rspec
+ rspec-rails
+ ruby-openid
+ sqlite3-ruby
+ webrat
+ will_paginate (~> 3.0.pre3)
+ xml-simple
View
@@ -1,12 +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'
-task :default => [:spec, :features]
+Enki::Application.load_tasks
View
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Enki::Application
View
@@ -0,0 +1,42 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module Enki
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ config.autoload_paths += %W(#{config.root}/lib)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # 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
+
+ # JavaScript files you want as :defaults (application.js is always included).
+ config.action_view.javascript_expansions[:defaults] = %w()
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+ end
+end
View
@@ -1,110 +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
-
-# 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)
@@ -3,17 +3,20 @@
development:
adapter: sqlite3
database: db/development.sqlite3
+ pool: 5
timeout: 5000
-# Warning: The database defined as 'test' will be erased and
-# re-generated from your development database when you run 'rake'.
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
+ pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
+ pool: 5
timeout: 5000
Oops, something went wrong.

0 comments on commit 3f111df

Please sign in to comment.