diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 9 | ||||
-rw-r--r-- | railties/lib/rails/application.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/commands.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/engine/configuration.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/active_model.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/generators/test_case.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/info.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/script_rails_loader.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/tasks/framework.rake | 2 | ||||
-rw-r--r-- | railties/lib/rails/version.rb | 2 | ||||
-rw-r--r-- | railties/test/application/middleware_test.rb | 3 | ||||
-rw-r--r-- | railties/test/application/routing_test.rb | 1 |
13 files changed, 24 insertions, 13 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 3cd9647799..fc1ec340c7 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,4 +1,4 @@ -*Rails 3.0.0 [Release Candidate] (unreleased)* +*Rails 3.0.0 [release candidate] (July 26th, 2010)* * Application generation: --skip-testunit and --skip-activerecord become --skip-test-unit and --skip-active-record respectively. [fxn] diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index 6ee7a4220b..fcf4ae29ba 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -2214,7 +2214,14 @@ NOTE: Defined in +active_support/core_ext/array/conversions.rb+. h4. Wrapping -The class method +Array.wrap+ behaves like the function +Array()+ except that it does not try to call +to_a+ on its argument. That changes the behavior for enumerables: +The class method +Array.wrap+ behaves like the function +Array()+ except: + +* If the argument responds to +to_ary+ the method is invoked. <tt>Kernel#Array</tt> moves on to try +to_a+ if the returned value is +nil+, but <tt>Arraw.wrap</tt> returns such a +nil+ right away. +* If the returned value from +to_ary+ is neither +nil+ nor an +Array+ object, <tt>Kernel#Array</tt> raises an exception, while <tt>Array.wrap</tt> does not, it just returns the value. +* It does not call +to_a+ on the argument, though special-cases +nil+ to return an empty array. + + + that it does not try to call +to_a+ on its argument. That changes the behavior for enumerables: <ruby> Array.wrap(:foo => :bar) # => [{:foo => :bar}] diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 3f9bca0bd6..6622cfdd2f 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -205,6 +205,7 @@ module Rails middleware.use ::ActionDispatch::ParamsParser middleware.use ::Rack::MethodOverride middleware.use ::ActionDispatch::Head + middleware.use ::ActionDispatch::BestStandardsSupport if config.action_dispatch.best_standards_support end end diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb index b9353ba336..60a93c9848 100644 --- a/railties/lib/rails/commands.rb +++ b/railties/lib/rails/commands.rb @@ -70,4 +70,4 @@ In addition to those, there are: All commands can be run with -h for more information. EOT -end
\ No newline at end of file +end diff --git a/railties/lib/rails/engine/configuration.rb b/railties/lib/rails/engine/configuration.rb index 2f465670cf..521ed95447 100644 --- a/railties/lib/rails/engine/configuration.rb +++ b/railties/lib/rails/engine/configuration.rb @@ -50,4 +50,4 @@ module Rails end end end -end
\ No newline at end of file +end diff --git a/railties/lib/rails/generators/active_model.rb b/railties/lib/rails/generators/active_model.rb index fe6321af30..4b828340d2 100644 --- a/railties/lib/rails/generators/active_model.rb +++ b/railties/lib/rails/generators/active_model.rb @@ -9,16 +9,16 @@ module Rails # For example: # # ActiveRecord::Generators::ActiveModel.find(Foo, "params[:id]") - # #=> "Foo.find(params[:id])" + # # => "Foo.find(params[:id])" # # Datamapper::Generators::ActiveModel.find(Foo, "params[:id]") - # #=> "Foo.get(params[:id])" + # # => "Foo.get(params[:id])" # # On initialization, the ActiveModel accepts the instance name that will # receive the calls: # # builder = ActiveRecord::Generators::ActiveModel.new "@foo" - # builder.save #=> "@foo.save" + # builder.save # => "@foo.save" # # The only exception in ActiveModel for ActiveRecord is the use of self.build # instead of self.new. diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 36bc542ffe..3376b422cb 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -68,7 +68,7 @@ module Rails # Captures the given stream and returns it: # # stream = capture(:stdout){ puts "Cool" } - # stream #=> "Cool\n" + # stream # => "Cool\n" # def capture(stream) begin diff --git a/railties/lib/rails/info.rb b/railties/lib/rails/info.rb index 96f2d9296e..6cbd1f21c0 100644 --- a/railties/lib/rails/info.rb +++ b/railties/lib/rails/info.rb @@ -88,7 +88,7 @@ module Rails end property 'Middleware' do - Rails.configuration.middleware.active.map(&:inspect) + Rails.configuration.middleware.map(&:inspect) end # The application's location on the filesystem. diff --git a/railties/lib/rails/script_rails_loader.rb b/railties/lib/rails/script_rails_loader.rb index 8fbd3bf492..91672e5d81 100644 --- a/railties/lib/rails/script_rails_loader.rb +++ b/railties/lib/rails/script_rails_loader.rb @@ -7,6 +7,7 @@ module Rails def self.exec_script_rails! cwd = Dir.pwd + return unless in_rails_application? || in_rails_application_subdirectory? exec RUBY, SCRIPT_RAILS, *ARGV if in_rails_application? Dir.chdir("..") do # Recurse in a chdir block: if the search fails we want to be sure @@ -18,7 +19,7 @@ module Rails end def self.in_rails_application? - File.exists?(SCRIPT_RAILS) || in_rails_application_subdirectory? + File.exists?(SCRIPT_RAILS) end def self.in_rails_application_subdirectory?(path = Pathname.new(Dir.pwd)) diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake index e7bd0c38dc..443dacd739 100644 --- a/railties/lib/rails/tasks/framework.rake +++ b/railties/lib/rails/tasks/framework.rake @@ -54,7 +54,7 @@ namespace :rails do namespace :update do def invoke_from_app_generator(method) - app_generator.invoke(method) + app_generator.send(method) end def app_generator diff --git a/railties/lib/rails/version.rb b/railties/lib/rails/version.rb index 34d96fd0f3..c5d1d02bc1 100644 --- a/railties/lib/rails/version.rb +++ b/railties/lib/rails/version.rb @@ -3,7 +3,7 @@ module Rails MAJOR = 3 MINOR = 0 TINY = 0 - BUILD = "beta4" + BUILD = "rc" STRING = [MAJOR, MINOR, TINY, BUILD].join('.') end diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index db9f06be5c..1f127cee78 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -34,7 +34,8 @@ module ApplicationTests "ActionDispatch::Flash", "ActionDispatch::ParamsParser", "Rack::MethodOverride", - "ActionDispatch::Head" + "ActionDispatch::Head", + "ActionDispatch::BestStandardsSupport" ], middleware end diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb index f0268164d0..a10a39ef40 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -40,6 +40,7 @@ module ApplicationTests get '/foo' assert_equal 'foo', last_response.body + assert_equal "IE=Edge,chrome=1", last_response.headers["X-UA-Compatible"] end test "simple controller with helper" do |