summaryrefslogtreecommitdiff
path: root/kernel.rb
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-01-12 22:12:02 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-01-12 22:12:02 +0900
commit344a824ef9d4b6152703d02d7ffa042abd4252c1 (patch)
tree7c2b091b5c89d296d7d2d61a995b9adf6c201480 /kernel.rb
parent0dc95266e8c36dbc3bfdcb88d820cb7f897166d7 (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.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel.rb b/kernel.rb
index 4f7f6a38ca..de20fffcf9 100644
--- a/kernel.rb
+++ b/kernel.rb
@@ -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