зеркало из https://github.com/github/aws-s3.git
Fixes instance of Ruby version = 1.8.7 for Kernel method (for real)
This commit is contained in:
Родитель
b8e453834b
Коммит
d8997822cf
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче