зеркало из https://github.com/github/ruby.git
[ruby/uri] Only use UnboundMethod#bind_call if it is available
This allows tests to pass on Ruby 2.4-2.6. Fixes #19 https://github.com/ruby/uri/commit/67ca99ca87
This commit is contained in:
Родитель
3e27ca6047
Коммит
10ad81eb2d
|
@ -322,8 +322,14 @@ module URI
|
|||
end
|
||||
|
||||
@@to_s = Kernel.instance_method(:to_s)
|
||||
def inspect
|
||||
@@to_s.bind_call(self)
|
||||
if @@to_s.respond_to?(:bind_call)
|
||||
def inspect
|
||||
@@to_s.bind_call(self)
|
||||
end
|
||||
else
|
||||
def inspect
|
||||
@@to_s.bind(self).call
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -79,8 +79,14 @@ module URI
|
|||
end
|
||||
|
||||
@@to_s = Kernel.instance_method(:to_s)
|
||||
def inspect
|
||||
@@to_s.bind_call(self)
|
||||
if @@to_s.respond_to?(:bind_call)
|
||||
def inspect
|
||||
@@to_s.bind_call(self)
|
||||
end
|
||||
else
|
||||
def inspect
|
||||
@@to_s.bind(self).call
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Загрузка…
Ссылка в новой задаче