From b8e453834b994aec7714991b61faa8a33815dc99 Mon Sep 17 00:00:00 2001 From: Harry Love Date: Tue, 28 Apr 2009 14:12:05 -0600 Subject: [PATCH 1/2] Fixes instance of Ruby version = 1.8.7 for Kernel method --- lib/aws/s3/extensions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/aws/s3/extensions.rb b/lib/aws/s3/extensions.rb index 2c9677f..ec854f9 100644 --- a/lib/aws/s3/extensions.rb +++ b/lib/aws/s3/extensions.rb @@ -131,10 +131,10 @@ module Kernel def __called_from__ caller[1][/`([^']+)'/, 1] - end if RUBY_VERSION > '1.8.7' + end if RUBY_VERSION >= '1.8.7' def expirable_memoize(reload = false, storage = nil) - current_method = RUBY_VERSION > '1.8.7' ? __called_from__ : __method__(1) + current_method = RUBY_VERSION >= '1.8.7' ? __called_from__ : __method__(1) storage = "@#{storage || current_method}" if reload instance_variable_set(storage, nil) From d8997822cfd4de9fe628f7478dbc11da623df976 Mon Sep 17 00:00:00 2001 From: Harry Love Date: Tue, 28 Apr 2009 15:35:29 -0600 Subject: [PATCH 2/2] Fixes instance of Ruby version = 1.8.7 for Kernel method (for real) --- lib/aws/s3/extensions.rb | 6 +++--- test/extensions_test.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/aws/s3/extensions.rb b/lib/aws/s3/extensions.rb index ec854f9..1cc9da5 100644 --- a/lib/aws/s3/extensions.rb +++ b/lib/aws/s3/extensions.rb @@ -127,14 +127,14 @@ end module Kernel def __method__(depth = 0) caller[depth][/`([^']+)'/, 1] - end if RUBY_VERSION < '1.8.7' + end if RUBY_VERSION <= '1.8.7' def __called_from__ caller[1][/`([^']+)'/, 1] - end if RUBY_VERSION >= '1.8.7' + end if RUBY_VERSION > '1.8.7' def expirable_memoize(reload = false, storage = nil) - current_method = RUBY_VERSION >= '1.8.7' ? __called_from__ : __method__(1) + current_method = RUBY_VERSION > '1.8.7' ? __called_from__ : __method__(1) storage = "@#{storage || current_method}" if reload instance_variable_set(storage, nil) diff --git a/test/extensions_test.rb b/test/extensions_test.rb index 8bbe100..2ad770a 100644 --- a/test/extensions_test.rb +++ b/test/extensions_test.rb @@ -139,7 +139,7 @@ class KerneltExtensionsTest < Test::Unit::TestCase assert_equal 'foo', b.foo assert_equal 'bar', b.bar end -end if RUBY_VERSION < '1.8.7' +end if RUBY_VERSION <= '1.8.7' class ModuleExtensionsTest < Test::Unit::TestCase class Foo