[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
1 changed files with 2 additions and 2 deletions

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