diff --git a/Rakefile b/Rakefile index cffd19f0..3bb0e859 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,5 @@ # Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake. +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require(File.join(File.dirname(__FILE__), 'config', 'boot')) @@ -7,4 +7,4 @@ require 'rake' require 'rake/testtask' require 'rake/rdoctask' -require 'tasks/rails' \ No newline at end of file +require 'tasks/rails' diff --git a/config/boot.rb b/config/boot.rb index bb844558..6686664c 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -62,8 +62,12 @@ module Rails 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 + if load_error.message =~ /Could not find RubyGem rails/ + 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 + else + raise + end end class << self @@ -106,60 +110,5 @@ module Rails end end -# TODO: Workaround for #7013 to be removed for 1.2.0 -# Loads i18n 0.4.2 before Rails loads any more recent gem -# 0.5.0 is not compatible with the old interpolation syntax -# Plugins will have to migrate to the new syntax for 1.2.0 -require 'rubygems' -begin - gem 'i18n', '0.4.2' -rescue Gem::LoadError => load_error - $stderr.puts %(Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`) - exit 1 -end - -# TODO: Workaround for rubygems > 1.5 compatibility (#133), to be removed -# for Rails > 2.3.5 -# -# Fixes the deprecation warning about removal of version_requirements for -# rubygems < 1.5 and provide a workaround for rubygems >= 1.5 where that -# method was finally removed. -module Rails - # See lib/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb - class GemDependency < Gem::Dependency - def dependencies - return [] if framework_gem? - return [] unless installed? - specification.dependencies.reject do |dependency| - dependency.type == :development - end.map do |dependency| - GemDependency.new(dependency.name, - :requirement => (dependency.respond_to?(:requirement) ? - dependency.requirement : - dependency.version_requirements)) - end - end - - if method_defined?(:requirement) - # rubygem > 1.5 - def requirement - req = super - req unless req == Gem::Requirement.default - end - # bypass passenger error - alias :version_requirements :requirement - else - # rubygem < 1.5 - def requirement - req = version_requirements - req unless req == Gem::Requirement.default - end - end - end -end - -# working around deprecation in RubyGems 1.6 -require 'thread' - # All that for this: Rails.boot! diff --git a/config/environments/development.rb b/config/environments/development.rb index c816f03e..85c9a608 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -3,14 +3,15 @@ # 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 +config.cache_classes = false # Log error messages when you accidentally call methods on nil. -config.whiny_nils = true +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 +config.action_mailer.raise_delivery_errors = false \ No newline at end of file diff --git a/config/initializers/new_rails_defaults.rb b/config/initializers/new_rails_defaults.rb new file mode 100644 index 00000000..0039a3b2 --- /dev/null +++ b/config/initializers/new_rails_defaults.rb @@ -0,0 +1,21 @@ +# Be sure to restart your server when you modify this file. + +# These settings change the behavior of Rails 2 apps and will be defaults +# for Rails 3. You can remove this initializer when Rails 3 is released. + +if defined?(ActiveRecord) + # Include Active Record class name as root for JSON serialized output. + ActiveRecord::Base.include_root_in_json = true + + # Store the full class name (including module namespace) in STI type column. + ActiveRecord::Base.store_full_sti_class = true +end + +ActionController::Routing.generate_best_match = true + +# Use ISO 8601 format for JSON serialized times and dates. +ActiveSupport.use_standard_json_time_format = true + +# Don't escape HTML entities in JSON, leave that for the #json_escape helper. +# if you're including raw json in an HTML page. +ActiveSupport.escape_html_entities_in_json = false diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 00000000..3174d0cb --- /dev/null +++ b/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' }]) +# Major.create(:name => 'Daley', :city => cities.first) diff --git a/public/422.html b/public/422.html new file mode 100644 index 00000000..b54e4a3c --- /dev/null +++ b/public/422.html @@ -0,0 +1,30 @@ + + + + + + + The change you wanted was rejected (422) + + + + + +
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+ + \ No newline at end of file diff --git a/script/dbconsole b/script/dbconsole old mode 100644 new mode 100755 diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb new file mode 100644 index 00000000..4b60558b --- /dev/null +++ b/test/performance/browsing_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' +require 'performance_test_help' + +# Profiling results for each test method are written to tmp/performance. +class BrowsingTest < ActionController::PerformanceTest + def test_homepage + get '/' + end +end