From 391ee3ee3acb2553b5ae7817373eaf3fce891e07 Mon Sep 17 00:00:00 2001 From: Masataka Pocke Kuwabara Date: Fri, 8 Jan 2021 23:52:35 +0900 Subject: Replace `Kernel.#open` with `URI.open` in doc Because `Kernel.#open` no longer opens URI since Ruby 3.0. --- enumerator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'enumerator.c') diff --git a/enumerator.c b/enumerator.c index 6d6a588af9..08d08ecc2e 100644 --- a/enumerator.c +++ b/enumerator.c @@ -1711,13 +1711,13 @@ lazy_generator_init(VALUE enumerator, VALUE procs) * * # This will fetch all URLs before selecting * # necessary data - * URLS.map { |u| JSON.parse(open(u).read) } + * URLS.map { |u| JSON.parse(URI.open(u).read) } * .select { |data| data.key?('stats') } * .first(5) * * # This will fetch URLs one-by-one, only till * # there is enough data to satisfy the condition - * URLS.lazy.map { |u| JSON.parse(open(u).read) } + * URLS.lazy.map { |u| JSON.parse(URI.open(u).read) } * .select { |data| data.key?('stats') } * .first(5) * -- cgit v1.2.1