diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-11-14 17:41:25 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-11-14 17:41:25 +0530 |
commit | 17b1387646a9537c978e9d7c5f3a68f740cd9377 (patch) | |
tree | 81735b97603471bb9780ed0fd133dad7a16f59a7 /activesupport | |
parent | fa9ea057d1252a578f8e056defef41b93853bc8b (diff) | |
parent | 549b18c9286b6cccf4978093576325fd711dc421 (diff) | |
download | rails-17b1387646a9537c978e9d7c5f3a68f740cd9377.tar.gz rails-17b1387646a9537c978e9d7c5f3a68f740cd9377.tar.bz2 rails-17b1387646a9537c978e9d7c5f3a68f740cd9377.zip |
Merge commit 'mainstream/master'
Conflicts:
railties/doc/guides/html/actioncontroller_basics.html
railties/doc/guides/html/activerecord_validations_callbacks.html
railties/doc/guides/html/debugging_rails_applications.html
railties/doc/guides/html/testing_rails_applications.html
railties/doc/guides/source/actioncontroller_basics/methods.txt
railties/doc/guides/source/actioncontroller_basics/params.txt
railties/doc/guides/source/actioncontroller_basics/request_response_objects.txt
railties/doc/guides/source/actioncontroller_basics/session.txt
railties/doc/guides/source/activerecord_validations_callbacks.txt
railties/doc/guides/source/debugging_rails_applications.txt
railties/doc/guides/source/testing_rails_applications.txt
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/CHANGELOG | 4 | ||||
-rw-r--r-- | activesupport/Rakefile | 3 | ||||
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 12 | ||||
-rw-r--r-- | activesupport/lib/active_support/inflector.rb | 1 | ||||
-rw-r--r-- | activesupport/lib/active_support/rescuable.rb | 8 | ||||
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 7 | ||||
-rw-r--r-- | activesupport/lib/active_support/vendor.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb (renamed from activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb) | 6 | ||||
-rw-r--r-- | activesupport/lib/active_support/version.rb | 2 | ||||
-rw-r--r-- | activesupport/test/caching_test.rb | 6 | ||||
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/dependencies_test.rb | 10 | ||||
-rw-r--r-- | activesupport/test/time_zone_test.rb | 2 |
13 files changed, 41 insertions, 26 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index e77affc315..3526c2e8fc 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,6 +1,4 @@ -*2.2.1 [RC2 or 2.2 final]* - -* Added render :js for people who want to render inline JavaScript replies without using RJS [DHH] +*2.2.1 [RC2] (November 14th, 2008)* * Fixed the option merging in Array#to_xml #1126 [Rudolf Gavlas] diff --git a/activesupport/Rakefile b/activesupport/Rakefile index 1961fb43cf..ccbab525ba 100644 --- a/activesupport/Rakefile +++ b/activesupport/Rakefile @@ -1,7 +1,6 @@ require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' -require 'rake/contrib/sshpublisher' require File.join(File.dirname(__FILE__), 'lib', 'active_support', 'version') @@ -65,12 +64,14 @@ end desc "Publish the beta gem" task :pgem => [:package] do + require 'rake/contrib/sshpublisher' Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'` end desc "Publish the API documentation" task :pdoc => [:rdoc] do + require 'rake/contrib/sshpublisher' Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/as", "doc").upload end diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 3d871eec11..fe568d6127 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -138,14 +138,22 @@ module ActiveSupport #:nodoc: end def load_with_new_constant_marking(file, *extras) #:nodoc: - Dependencies.new_constants_in(Object) { load_without_new_constant_marking(file, *extras) } + if Dependencies.load? + Dependencies.new_constants_in(Object) { load_without_new_constant_marking(file, *extras) } + else + load_without_new_constant_marking(file, *extras) + end rescue Exception => exception # errors from loading file exception.blame_file! file raise end def require(file, *extras) #:nodoc: - Dependencies.new_constants_in(Object) { super } + if Dependencies.load? + Dependencies.new_constants_in(Object) { super } + else + super + end rescue Exception => exception # errors from required file exception.blame_file! file raise diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb index 1ccfec4000..ba52e41c08 100644 --- a/activesupport/lib/active_support/inflector.rb +++ b/activesupport/lib/active_support/inflector.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require 'singleton' require 'iconv' diff --git a/activesupport/lib/active_support/rescuable.rb b/activesupport/lib/active_support/rescuable.rb index f2bc12e832..c27c4ddb1a 100644 --- a/activesupport/lib/active_support/rescuable.rb +++ b/activesupport/lib/active_support/rescuable.rb @@ -78,7 +78,7 @@ module ActiveSupport def handler_for_rescue(exception) # We go from right to left because pairs are pushed onto rescue_handlers # as rescue_from declarations are found. - _, handler = Array(rescue_handlers).reverse.detect do |klass_name, handler| + _, rescuer = Array(rescue_handlers).reverse.detect do |klass_name, handler| # The purpose of allowing strings in rescue_from is to support the # declaration of handler associations for exception classes whose # definition is yet unknown. @@ -97,11 +97,11 @@ module ActiveSupport exception.is_a?(klass) if klass end - case handler + case rescuer when Symbol - method(handler) + method(rescuer) when Proc - handler.bind(self) + rescuer.bind(self) end end end diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 4991f71683..1d87fa64b5 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -304,7 +304,8 @@ module ActiveSupport "Mexico City", "Monterrey", "Central America" ], [-18_000, "Eastern Time (US & Canada)", "Indiana (East)", "Bogota", "Lima", "Quito" ], - [-14_400, "Atlantic Time (Canada)", "Caracas", "La Paz", "Santiago" ], + [-16_200, "Caracas" ], + [-14_400, "Atlantic Time (Canada)", "La Paz", "Santiago" ], [-12_600, "Newfoundland" ], [-10_800, "Brasilia", "Buenos Aires", "Georgetown", "Greenland" ], [ -7_200, "Mid-Atlantic" ], @@ -325,9 +326,9 @@ module ActiveSupport [ 14_400, "Abu Dhabi", "Muscat", "Baku", "Tbilisi", "Yerevan" ], [ 16_200, "Kabul" ], [ 18_000, "Ekaterinburg", "Islamabad", "Karachi", "Tashkent" ], - [ 19_800, "Chennai", "Kolkata", "Mumbai", "New Delhi" ], + [ 19_800, "Chennai", "Kolkata", "Mumbai", "New Delhi", "Sri Jayawardenepura" ], [ 20_700, "Kathmandu" ], - [ 21_600, "Astana", "Dhaka", "Sri Jayawardenepura", "Almaty", + [ 21_600, "Astana", "Dhaka", "Almaty", "Novosibirsk" ], [ 23_400, "Rangoon" ], [ 25_200, "Bangkok", "Hanoi", "Jakarta", "Krasnoyarsk" ], diff --git a/activesupport/lib/active_support/vendor.rb b/activesupport/lib/active_support/vendor.rb index 633eb2ef08..dc98936525 100644 --- a/activesupport/lib/active_support/vendor.rb +++ b/activesupport/lib/active_support/vendor.rb @@ -14,9 +14,9 @@ rescue Gem::LoadError end begin - gem 'memcache-client', '~> 1.5.0' + gem 'memcache-client', '~> 1.5.1' rescue Gem::LoadError - $:.unshift "#{File.dirname(__FILE__)}/vendor/memcache-client-1.5.0" + $:.unshift "#{File.dirname(__FILE__)}/vendor/memcache-client-1.5.1" end begin diff --git a/activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb b/activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb index 30113201a6..99c9af0398 100644 --- a/activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb +++ b/activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb @@ -1,10 +1,10 @@ # All original code copyright 2005, 2006, 2007 Bob Cottrell, Eric Hodel, # The Robot Co-op. All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: -# +# # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright @@ -13,7 +13,7 @@ # 3. Neither the names of the authors nor the names of their contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. -# +# # THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/activesupport/lib/active_support/version.rb b/activesupport/lib/active_support/version.rb index 8f5395fca6..6631f233f1 100644 --- a/activesupport/lib/active_support/version.rb +++ b/activesupport/lib/active_support/version.rb @@ -2,7 +2,7 @@ module ActiveSupport module VERSION #:nodoc: MAJOR = 2 MINOR = 2 - TINY = 0 + TINY = 1 STRING = [MAJOR, MINOR, TINY].join('.') end diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index cc371b3a7b..e7dac4cc6b 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -160,6 +160,12 @@ uses_memcached 'memcached backed store' do @cache.read('foo').gsub!(/.*/, 'baz') assert_equal 'bar', @cache.read('foo') end + + def test_write_should_return_true_on_success + result = @cache.write('foo', 'bar') + assert_equal 'bar', @cache.read('foo') # make sure 'foo' was written + assert result + end end class CompressedMemCacheStore < Test::Unit::TestCase diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 11ec1c6cd6..fd17f7a812 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -123,7 +123,7 @@ class TimeExtCalculationsTest < Test::Unit::TestCase def test_end_of_year assert_equal Time.local(2007,12,31,23,59,59), Time.local(2007,2,22,10,10,10).end_of_year assert_equal Time.local(2007,12,31,23,59,59), Time.local(2007,12,31,10,10,10).end_of_year - end + end def test_beginning_of_year assert_equal Time.local(2005,1,1,0,0,0), Time.local(2005,2,22,10,10,10).beginning_of_year diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index 6c3bd1a4fd..fe04b91f2b 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -694,17 +694,17 @@ class DependenciesTest < Test::Unit::TestCase with_loading 'autoloading_fixtures' do ActiveSupport::Dependencies.mechanism = :require 2.times do - assert_raise(NameError) {"RaisesNameError".constantize} + assert_raise(NameError) { assert_equal 123, ::RaisesNameError::FooBarBaz } end end end def test_autoload_doesnt_shadow_name_error with_loading 'autoloading_fixtures' do - assert !defined?(::RaisesNameError), "::RaisesNameError is defined but it hasn't been referenced yet!" + Object.send(:remove_const, :RaisesNameError) if defined?(::RaisesNameError) 2.times do begin - ::RaisesNameError.object_id + ::RaisesNameError::FooBarBaz.object_id flunk 'should have raised NameError when autoloaded file referenced FooBarBaz' rescue NameError => e assert_equal 'uninitialized constant RaisesNameError::FooBarBaz', e.message @@ -712,9 +712,9 @@ class DependenciesTest < Test::Unit::TestCase assert !defined?(::RaisesNameError), "::RaisesNameError is defined but it should have failed!" end - assert !defined?(RaisesNameError) + assert !defined?(::RaisesNameError) 2.times do - assert_raise(NameError) { RaisesNameError } + assert_raise(NameError) { ::RaisesNameError } assert !defined?(::RaisesNameError), "::RaisesNameError is defined but it should have failed!" end end diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index 515ffcf0bf..d999b9f2a8 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -51,7 +51,7 @@ class TimeZoneTest < Test::Unit::TestCase define_method("test_utc_offset_for_#{name}") do silence_warnings do # silence warnings raised by tzinfo gem - period = zone.tzinfo.period_for_utc(Time.utc(2006,1,1,0,0,0)) + period = zone.tzinfo.period_for_utc(Time.utc(2009,1,1,0,0,0)) assert_equal period.utc_offset, zone.utc_offset end end |