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:
parent
0dc95266e8
commit
344a824ef9
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue