From: akr@... Date: 2020-03-06T06:00:26+00:00 Subject: [ruby-core:97377] [Ruby master Misc#15893] open-uri: URI.open status Issue #15893 has been updated by akr (Akira Tanaka). cabo (Carsten Bormann) wrote in #note-3: > So what is code that needs to be portable to older Rubies supposed to call now? `URI.open` only works since 2.5. We need to support 2.3 and 2.4 as well. > > `OpenURI.open_uri` ? You can use URI#open. ``` % ruby-2.3.0 -ropen-uri -e 'URI("http://www.ruby-lang.org").open {|f| p f.read[1..20] }' "!DOCTYPE html>\n\n\n\n\n URI.open method defined as an alias to open-uri's Kernel.open. open-uri's Kernel.open will be deprecated in future. I believe there were good reasons for that decision. On the other hand, * no movements in this direction were done since 2.5 * `URI.open` [is excluded](https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb#L43) from `open-uri`'s docs, and the main library's [documentation](https://ruby-doc.org/stdlib-2.5.0/libdoc/open-uri/rdoc/OpenURI.html) doesn't mention this option as preferred or even existing. I'd like to know what the real status of this library and its migration to (safer) `URI.open`? Should a patch be provided to change the library's docs accordingly? Maybe even change the code (still leaving `Kernel.open` option, but just as an alias, moving the implementation away from that method)? ---Files-------------------------------- deprecate-open-uri-kernel-open.patch (21.3 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: