diff options
Diffstat (limited to 'lib/open-uri.rb')
-rw-r--r-- | lib/open-uri.rb | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb index dd68ea75d9..421a82ed0d 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -3,27 +3,6 @@ require 'uri' require 'stringio' require 'time' -module Kernel - private - alias open_uri_original_open open # :nodoc: - class << self - alias open_uri_original_open open # :nodoc: - end - - def open(name, *rest, **kw, &block) # :nodoc: - if (name.respond_to?(:open) && !name.respond_to?(:to_path)) || - (name.respond_to?(:to_str) && - %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ name && - (uri = URI.parse(name)).respond_to?(:open)) - warn('calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open', uplevel: 1) - URI.open(name, *rest, **kw, &block) - else - open_uri_original_open(name, *rest, **kw, &block) - end - end - module_function :open -end - module URI # Allows the opening of various resources including URIs. # @@ -49,9 +28,7 @@ module URI (uri = URI.parse(name)).respond_to?(:open) uri.open(*rest, &block) else - open_uri_original_open(name, *rest, &block) - # After Kernel#open override is removed: - #super + super end end end |