Module: Kernel

Defined in:
lib/open-uri.rb

Class Method Summary collapse

Class Method Details

.open(name, *rest, **kw, &block) ⇒ Object

:nodoc:



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/open-uri.rb', line 13

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

.open_uri_original_openObject

:nodoc:



10
# File 'lib/open-uri.rb', line 10

alias open_uri_original_open open