From 8fd52705eda6a2cd7e9a8a5bc723fa094e359eb7 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Mon, 22 Dec 2014 20:14:14 -0800 Subject: fix ruby 2.2 warning: circular argument reference --- activesupport/lib/active_support/values/time_zone.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index f935180036..618c93125c 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -267,7 +267,7 @@ module ActiveSupport # # Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00 # Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00 - def parse(str, now=now) + def parse(str, now=now()) parts = Date._parse(str, false) return if parts.empty? -- cgit v1.2.3 From 047b2a9fcf893287a01de621dc40d6b29e701747 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 9 Jan 2014 14:12:05 -0800 Subject: Check `respond_to` before delegation due to: https://github.com/ruby/ruby/commit/d781caaf313b8649948c107bba277e5ad7307314 --- .../lib/active_support/core_ext/date_time/calculations.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/date_time/calculations.rb b/activesupport/lib/active_support/core_ext/date_time/calculations.rb index 0481bd2195..0ff36eeb6d 100644 --- a/activesupport/lib/active_support/core_ext/date_time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date_time/calculations.rb @@ -138,6 +138,12 @@ class DateTime # Layers additional behavior on DateTime#<=> so that Time and ActiveSupport::TimeWithZone instances can be compared with a DateTime def <=>(other) - super other.kind_of?(Infinity) ? other : other.to_datetime + if other.kind_of?(Infinity) + super + elsif other.respond_to? :to_datetime + super other.to_datetime + else + nil + end end end -- cgit v1.2.3 From aa01162ffeba391329ab2b8559d9aa6d0182b74e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 24 Dec 2014 09:59:21 +0900 Subject: added dependency of test-unit into activesupport --- activesupport/activesupport.gemspec | 1 + 1 file changed, 1 insertion(+) (limited to 'activesupport') diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index e131ca7d68..97fa5450c4 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -22,4 +22,5 @@ Gem::Specification.new do |s| s.add_dependency('i18n', '~> 0.6', '>= 0.6.4') s.add_dependency('multi_json', '~> 1.0') + s.add_dependency('test-unit', '~> 2.5') end -- cgit v1.2.3 From a51bb36fdb59bd0ecf8b462c98e90e30d80107c1 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Fri, 2 Jan 2015 18:17:04 -0800 Subject: try using newer test-unit gem --- activesupport/activesupport.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index 97fa5450c4..7dd20f5e04 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -22,5 +22,5 @@ Gem::Specification.new do |s| s.add_dependency('i18n', '~> 0.6', '>= 0.6.4') s.add_dependency('multi_json', '~> 1.0') - s.add_dependency('test-unit', '~> 2.5') + s.add_dependency('test-unit', '~> 3.0') end -- cgit v1.2.3 From 98dbc5e3cc248859b8c881dbcd228f8ad0743f21 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Fri, 2 Jan 2015 21:04:03 -0800 Subject: fix yaml compat on ruby 2.2 --- activesupport/lib/active_support/core_ext/big_decimal/conversions.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb b/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb index 391bdc925d..d2039fcc1e 100644 --- a/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb +++ b/activesupport/lib/active_support/core_ext/big_decimal/conversions.rb @@ -16,7 +16,9 @@ class BigDecimal # # Note that reconstituting YAML floats to native floats may lose precision. def to_yaml(opts = {}) - return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck? + return super if + (defined?(YAML::ENGINE) && !YAML::ENGINE.syck?) || + (defined?(Psych) && YAML == Psych) YAML.quick_emit(nil, opts) do |out| string = to_s -- cgit v1.2.3 From 2f558088acb2ab65ed4dcd87a8ef42d1b26a8035 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Mon, 14 Oct 2013 22:40:21 +0530 Subject: Fix `singleton_class?` Due to changes from http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39628 current `singleton_class?` implementation fails. Changed based on reference from http://bugs.ruby-lang.org/issues/7609 Conflicts: activesupport/lib/active_support/core_ext/class/attribute.rb --- activesupport/lib/active_support/core_ext/class/attribute.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb index cd7877fce4..14adc426d8 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute.rb @@ -109,7 +109,9 @@ class Class end private - def singleton_class? - ancestors.first != self - end + unless respond_to?(:singleton_class?) + def singleton_class? + ancestors.first != self + end + end end -- cgit v1.2.3 From 3a30b12c774dfaa72acfe520e823374131631ea9 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Fri, 2 Jan 2015 22:03:42 -0800 Subject: use self.method syntax to resolve circular argument issues --- activesupport/lib/active_support/values/time_zone.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 618c93125c..01aea0984b 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -267,7 +267,7 @@ module ActiveSupport # # Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00 # Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00 - def parse(str, now=now()) + def parse(str, now=self.now) parts = Date._parse(str, false) return if parts.empty? -- cgit v1.2.3 From 683f541d784e7aa15285c2eea5245d697c7120f7 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Fri, 2 Jan 2015 22:03:54 -0800 Subject: fix whitespace to match surrounding code --- activesupport/activesupport.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index 7dd20f5e04..f3c22871e5 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -22,5 +22,5 @@ Gem::Specification.new do |s| s.add_dependency('i18n', '~> 0.6', '>= 0.6.4') s.add_dependency('multi_json', '~> 1.0') - s.add_dependency('test-unit', '~> 3.0') + s.add_dependency('test-unit', '~> 3.0') end -- cgit v1.2.3