diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-01-12 22:12:02 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-01-12 22:12:02 +0900 |
commit | 344a824ef9d4b6152703d02d7ffa042abd4252c1 (patch) | |
tree | 7c2b091b5c89d296d7d2d61a995b9adf6c201480 /kernel.rb | |
parent | 0dc95266e8c36dbc3bfdcb88d820cb7f897166d7 (diff) |
[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
Diffstat (limited to 'kernel.rb')
-rw-r--r-- | kernel.rb | 4 |
1 files changed, 2 insertions, 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 |