1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[DOC] Use URI#read instead of URI.open for better compatibility

- URI.open is available since 2.5.0, but URI#read is available since 1.8.0.
- Fix `open` without `close`.
- ref https://github.com/rurema/doctree/pull/2433
This commit is contained in:
Kazuhiro NISHIYAMA 2021-01-12 22:12:02 +09:00
parent 0dc95266e8
commit 344a824ef9
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A

View file

@ -105,7 +105,7 @@ module Kernel
# require 'json'
#
# construct_url(arguments).
# then {|url| URI.open(url).read }.
# then {|url| URI(url).read }.
# then {|response| JSON.parse(response) }
#
# When called without block, the method returns +Enumerator+,
@ -138,7 +138,7 @@ module Kernel
# require 'json'
#
# construct_url(arguments).
# then {|url| URI.open(url).read }.
# then {|url| URI(url).read }.
# then {|response| JSON.parse(response) }
#
def yield_self