From dabdec31e4f10a83036cfb368bf3a7d4d20cf2d8 Mon Sep 17 00:00:00 2001 From: kazu Date: Sat, 21 Oct 2017 14:40:03 +0000 Subject: Use caller with length to reduce unused strings git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/uri/common.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/uri') diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 74bbdea0a4..a082c2a918 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -100,7 +100,7 @@ module URI # # => "@%3F@%21" # def escape(*arg) - warn "#{caller(1)[0]}: warning: URI.escape is obsolete" if $VERBOSE + warn "#{caller(1, 1)[0]}: warning: URI.escape is obsolete" if $VERBOSE DEFAULT_PARSER.escape(*arg) end alias encode escape @@ -132,7 +132,7 @@ module URI # # => "http://example.com/?a=\t\r" # def unescape(*arg) - warn "#{caller(1)[0]}: warning: URI.unescape is obsolete" if $VERBOSE + warn "#{caller(1, 1)[0]}: warning: URI.unescape is obsolete" if $VERBOSE DEFAULT_PARSER.unescape(*arg) end alias decode unescape @@ -300,7 +300,7 @@ module URI # # => ["http://foo.example.com/bla", "mailto:test@example.com"] # def self.extract(str, schemes = nil, &block) - warn "#{caller(1)[0]}: warning: URI.extract is obsolete" if $VERBOSE + warn "#{caller(1, 1)[0]}: warning: URI.extract is obsolete" if $VERBOSE DEFAULT_PARSER.extract(str, schemes, &block) end @@ -336,7 +336,7 @@ module URI # end # def self.regexp(schemes = nil) - warn "#{caller(1)[0]}: warning: URI.regexp is obsolete" if $VERBOSE + warn "#{caller(1, 1)[0]}: warning: URI.regexp is obsolete" if $VERBOSE DEFAULT_PARSER.make_regexp(schemes) end -- cgit v1.2.3