From 344a824ef9d4b6152703d02d7ffa042abd4252c1 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Tue, 12 Jan 2021 22:12:02 +0900 Subject: [PATCH] [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 --- kernel.rb | 4 ++-- 1 file 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