ruby-changes:59334
From: Kazuhiro <ko1@a...>
Date: Fri, 20 Dec 2019 01:40:23 +0900 (JST)
Subject: [ruby-changes:59334] 3816cd945d (master): Add `URI#open` to warning message
https://git.ruby-lang.org/ruby.git/commit/?id=3816cd945d From 3816cd945d68eac7ca8fecbc9d71f878ff3e7b3d Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Fri, 20 Dec 2019 01:40:00 +0900 Subject: Add `URI#open` to warning message diff --git a/lib/open-uri.rb b/lib/open-uri.rb index c099eba..c52f67f 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -15,7 +15,7 @@ module Kernel https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb#L15 (name.respond_to?(:to_str) && %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ name && (uri = URI.parse(name)).respond_to?(:open)) - warn('calling URI.open via Kernel#open is deprecated, call URI.open directly', uplevel: 1) + warn('calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open', uplevel: 1) URI.open(name, *rest, **kw, &block) else open_uri_original_open(name, *rest, **kw, &block) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/