aboutsummaryrefslogtreecommitdiffstats
path: root/enumerator.c
diff options
context:
space:
mode:
authorMasataka Pocke Kuwabara <kuwabara@pocke.me>2021-01-08 23:52:35 +0900
committerJeremy Evans <code@jeremyevans.net>2021-01-08 07:31:27 -0800
commit391ee3ee3acb2553b5ae7817373eaf3fce891e07 (patch)
treeb5dd2407962babb3bc9359007243b9977ec603b0 /enumerator.c
parent98bd7e87a08b86c7aa95502428015c3f7b4aae75 (diff)
downloadruby-391ee3ee3acb2553b5ae7817373eaf3fce891e07.tar.gz
Replace `Kernel.#open` with `URI.open` in doc
Because `Kernel.#open` no longer opens URI since Ruby 3.0.
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c4
1 files changed, 2 insertions, 2 deletions
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)
*