Permalink
Browse files

in the process of upgrading to Rails 3

  • Loading branch information...
1 parent 928cbbb commit f6fd20da6617565a940fbeb5e5002d947b23cebf @ryanb committed Dec 7, 2010
Showing with 5,631 additions and 4,432 deletions.
  1. +2 −2 .gitignore
  2. +1 −0 .rvmrc
  3. +22 −0 Gemfile
  4. +123 −0 Gemfile.lock
  5. +2 −5 Rakefile
  6. +1 −8 app/controllers/application_controller.rb
  7. +0 −1 app/helpers/application_helper.rb
  8. +4 −0 config.ru
  9. +0 −1 config/app_config.example.yml
  10. +43 −0 config/application.rb
  11. +13 −110 config/boot.rb
  12. +4 −45 config/environment.rb
  13. +22 −13 config/environments/development.rb
  14. +41 −20 config/environments/production.rb
  15. +35 −32 config/environments/test.rb
  16. +2 −2 config/initializers/backtrace_silencers.rb
  17. +0 −5 config/initializers/hoptoad.rb
  18. +7 −7 config/initializers/inflections.rb
  19. +7 −0 config/initializers/secret_token.rb
  20. +3 −10 config/initializers/session_store.rb
  21. +1 −1 config/locales/en.yml
  22. +1 −1 config/routes.rb
  23. +7 −0 db/seeds.rb
  24. +0 −2 doc/README_FOR_APP
  25. 0 lib/tasks/.gitkeep
  26. +5 −3 public/javascripts/controls.js
  27. +7 −6 public/javascripts/dragdrop.js
  28. +8 −13 public/javascripts/effects.js
  29. +3,381 −1,700 public/javascripts/prototype.js
  30. +175 −0 public/javascripts/rails.js
  31. 0 public/stylesheets/.gitkeep
  32. +6 −0 script/rails
  33. +2 −2 test/performance/browsing_test.rb
  34. +2 −27 test/test_helper.rb
  35. 0 vendor/plugins/.gitkeep
  36. +0 −55 vendor/plugins/hoptoad_notifier/INSTALL
  37. +0 −22 vendor/plugins/hoptoad_notifier/MIT-LICENSE
  38. +0 −232 vendor/plugins/hoptoad_notifier/README
  39. +0 −30 vendor/plugins/hoptoad_notifier/Rakefile
  40. +0 −8 vendor/plugins/hoptoad_notifier/TESTING
  41. +0 −28 vendor/plugins/hoptoad_notifier/ginger_scenarios.rb
  42. +0 −1 vendor/plugins/hoptoad_notifier/install.rb
  43. +0 −418 vendor/plugins/hoptoad_notifier/lib/hoptoad_notifier.rb
  44. +0 −26 vendor/plugins/hoptoad_notifier/lib/hoptoad_tasks.rb
  45. +0 −22 vendor/plugins/hoptoad_notifier/recipes/hoptoad.rb
  46. +0 −28 vendor/plugins/hoptoad_notifier/script/integration_test.rb
  47. +0 −66 vendor/plugins/hoptoad_notifier/tasks/hoptoad_notifier_tasks.rake
  48. +0 −148 vendor/plugins/hoptoad_notifier/test/configuration_test.rb
  49. +0 −393 vendor/plugins/hoptoad_notifier/test/controller_test.rb
  50. +0 −113 vendor/plugins/hoptoad_notifier/test/helper.rb
  51. +0 −131 vendor/plugins/hoptoad_notifier/test/hoptoad_tasks_test.rb
  52. +0 −114 vendor/plugins/hoptoad_notifier/test/logger_test.rb
  53. +0 −191 vendor/plugins/hoptoad_notifier/test/notifier_test.rb
  54. +0 −1 vendor/plugins/hoptoad_notifier/vendor/ginger/.gitignore
  55. +0 −50 vendor/plugins/hoptoad_notifier/vendor/ginger/README.textile
  56. +0 −57 vendor/plugins/hoptoad_notifier/vendor/ginger/Rakefile
  57. +0 −42 vendor/plugins/hoptoad_notifier/vendor/ginger/bin/ginger
  58. +0 −33 vendor/plugins/hoptoad_notifier/vendor/ginger/ginger.gemspec
  59. +0 −21 vendor/plugins/hoptoad_notifier/vendor/ginger/lib/ginger.rb
  60. +0 −20 vendor/plugins/hoptoad_notifier/vendor/ginger/lib/ginger/configuration.rb
  61. +0 −56 vendor/plugins/hoptoad_notifier/vendor/ginger/lib/ginger/kernel.rb
  62. +0 −24 vendor/plugins/hoptoad_notifier/vendor/ginger/lib/ginger/scenario.rb
  63. +0 −7 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/ginger/configuration_spec.rb
  64. +0 −7 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/ginger/kernel_spec.rb
  65. +0 −50 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/ginger/scenario_spec.rb
  66. +0 −14 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/ginger_spec.rb
  67. +0 −7 vendor/plugins/hoptoad_notifier/vendor/ginger/spec/spec_helper.rb
  68. +1 −1 vendor/plugins/{hoptoad_notifier/vendor/ginger/LICENCE → rails_upgrade/MIT-LICENSE}
  69. +20 −0 vendor/plugins/rails_upgrade/README
  70. +22 −0 vendor/plugins/rails_upgrade/Rakefile
  71. +2 −0 vendor/plugins/rails_upgrade/init.rb
  72. +38 −0 vendor/plugins/rails_upgrade/install.rb
  73. +472 −0 vendor/plugins/rails_upgrade/lib/application_checker.rb
  74. +95 −0 vendor/plugins/rails_upgrade/lib/gemfile_generator.rb
  75. +51 −0 vendor/plugins/rails_upgrade/lib/new_configuration_generator.rb
  76. 0 vendor/plugins/rails_upgrade/lib/rails_upgrade.rb
  77. +349 −0 vendor/plugins/rails_upgrade/lib/routes_upgrader.rb
  78. +78 −0 vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake
  79. +293 −0 vendor/plugins/rails_upgrade/test/application_checker_test.rb
  80. +72 −0 vendor/plugins/rails_upgrade/test/gemfile_generator_test.rb
  81. +63 −0 vendor/plugins/rails_upgrade/test/new_configuration_generator_test.rb
  82. +142 −0 vendor/plugins/rails_upgrade/test/routes_upgrader_test.rb
  83. +5 −0 vendor/plugins/rails_upgrade/test/test_helper.rb
  84. +1 −0 vendor/plugins/rails_upgrade/uninstall.rb
View
@@ -1,7 +1,7 @@
+.bundle
+db/*.sqlite3
log/*.log
tmp/**/*
-*.sqlite3
database.yml
-app_config.yml
public/assets
config/session_secret.txt
View
@@ -0,0 +1 @@
+rvm use 1.9.2-p0
View
@@ -0,0 +1,22 @@
+source 'http://rubygems.org'
+
+gem "rails", "3.0.3"
+gem "sqlite3-ruby", :require => "sqlite3"
+gem "authlogic"
+gem "authlogic-oid", :require => "authlogic_openid"
+gem "ruby-openid", :require => "openid"
+gem "paperclip"
+gem "rmagick", :require => "RMagick"
+gem "jquery-rails"
+
+group :development, :test do
+ gem "mocha"
+ gem "rspec-rails"
+ gem "factory_girl_rails"
+ gem "autotest"
+ gem "autotest-rails"
+end
+
+group :development do
+ gem "nifty-generators"
+end
View
@@ -0,0 +1,123 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ ZenTest (4.4.1)
+ abstract (1.0.0)
+ actionmailer (3.0.3)
+ actionpack (= 3.0.3)
+ mail (~> 2.2.9)
+ actionpack (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.13)
+ rack-test (~> 0.5.6)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.3)
+ activesupport (= 3.0.3)
+ builder (~> 2.1.2)
+ i18n (~> 0.4)
+ activerecord (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ arel (~> 2.0.2)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ activesupport (3.0.3)
+ arel (2.0.6)
+ authlogic (2.1.6)
+ activesupport
+ authlogic-oid (1.0.4)
+ authlogic
+ autotest (4.4.6)
+ ZenTest (>= 4.4.1)
+ autotest-rails (4.1.0)
+ ZenTest
+ builder (2.1.2)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ factory_girl (1.3.2)
+ factory_girl_rails (1.0)
+ factory_girl (~> 1.3)
+ rails (>= 3.0.0.beta4)
+ i18n (0.5.0)
+ jquery-rails (0.2.6)
+ rails (~> 3.0)
+ thor (~> 0.14.4)
+ mail (2.2.12)
+ activesupport (>= 2.3.6)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ mocha (0.9.10)
+ rake
+ nifty-generators (0.4.2)
+ paperclip (2.3.6)
+ activerecord
+ activesupport
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-test (0.5.6)
+ rack (>= 1.0)
+ rails (3.0.3)
+ actionmailer (= 3.0.3)
+ actionpack (= 3.0.3)
+ activerecord (= 3.0.3)
+ activeresource (= 3.0.3)
+ activesupport (= 3.0.3)
+ bundler (~> 1.0)
+ railties (= 3.0.3)
+ railties (3.0.3)
+ actionpack (= 3.0.3)
+ activesupport (= 3.0.3)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
+ rake (0.8.7)
+ rmagick (2.13.1)
+ rspec (2.2.0)
+ rspec-core (~> 2.2)
+ rspec-expectations (~> 2.2)
+ rspec-mocks (~> 2.2)
+ rspec-core (2.2.1)
+ rspec-expectations (2.2.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.2.0)
+ rspec-rails (2.2.1)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ railties (~> 3.0)
+ rspec (~> 2.2.0)
+ ruby-openid (2.1.8)
+ sqlite3-ruby (1.3.2)
+ thor (0.14.6)
+ treetop (1.4.9)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.23)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ authlogic
+ authlogic-oid
+ autotest
+ autotest-rails
+ factory_girl_rails
+ jquery-rails
+ mocha
+ nifty-generators
+ paperclip
+ rails (= 3.0.3)
+ rmagick
+ rspec-rails
+ ruby-openid
+ sqlite3-ruby
View
@@ -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'
+Dailystamp::Application.load_tasks
@@ -1,13 +1,6 @@
-# Filters added to this controller apply to all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
-
class ApplicationController < ActionController::Base
include Authentication
- helper :all # include all helpers, all the time
- protect_from_forgery # See ActionController::RequestForgeryProtection for details
-
- # Scrub sensitive parameters from your log
- filter_parameter_logging :password
+ protect_from_forgery
before_filter :set_user_time_zone
@@ -1,4 +1,3 @@
-# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def mark_image(mark, size = 70)
options = {:size => "#{size}x#{size}", :class => "mark"}
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 Dailystamp::Application
@@ -1 +0,0 @@
-hoptoad_key: 123456789 # replace with real key
View
@@ -0,0 +1,43 @@
+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 Dailystamp
+ 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)'
+ config.time_zone = "Pacific 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(jquery rails)
+
+ # 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)
Oops, something went wrong. Retry.

0 comments on commit f6fd20d

Please sign in to comment.