Project

General

Profile

Feature #12882 ยป 0001-Prepend-warning-messages-with-caller-information.patch

jeremyevans0 (Jeremy Evans), 10/28/2016 08:55 PM

View differences:

ext/json/lib/json/ext.rb
6 6
  module Ext
7 7
    require 'json/ext/parser'
8 8
    require 'json/ext/generator'
9
    $DEBUG and warn "Using Ext extension for JSON."
9
    $DEBUG and warn "#{caller(0,1).first}: Using Ext extension for JSON."
10 10
    JSON.parser = Parser
11 11
    JSON.generator = Generator
12 12
  end
ext/openssl/lib/openssl/config.rb
285 285
    #
286 286
    # Use #get_value instead
287 287
    def value(arg1, arg2 = nil) # :nodoc:
288
      warn('Config#value is deprecated; use Config#get_value')
288
      warn("#{caller(1,1).first}: Config#value is deprecated; use Config#get_value")
289 289
      if arg2.nil?
290 290
        section, key = 'default', arg1
291 291
      else
......
346 346
    #
347 347
    # Use #[] instead
348 348
    def section(name) # :nodoc:
349
      warn('Config#section is deprecated; use Config#[]')
349
      warn("#{caller(1,1).first}: Config#section is deprecated; use Config#[]")
350 350
      @data[name] || {}
351 351
    end
352 352

  
ext/openssl/lib/openssl/pkey.rb
28 28

  
29 29
    # :nodoc:
30 30
    DEFAULT_TMP_DH_CALLBACK = lambda { |ctx, is_export, keylen|
31
      warn "using default DH parameters." if $VERBOSE
31
      warn "#{caller(1,1).first}: using default DH parameters." if $VERBOSE
32 32
      case keylen
33 33
      when 1024 then OpenSSL::PKey::DH::DEFAULT_1024
34 34
      when 2048 then OpenSSL::PKey::DH::DEFAULT_2048
ext/openssl/lib/openssl/x509.rb
156 156

  
157 157
    class StoreContext
158 158
      def cleanup
159
        warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
159
        warn "#{caller(1,1).first}: OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
160 160
      end
161 161
    end
162 162

  
ext/psych/lib/psych/coder.rb
23 23

  
24 24
    def scalar *args
25 25
      if args.length > 0
26
        warn "#{caller[0]}: Coder#scalar(a,b,c) is deprecated" if $VERBOSE
26
        warn "#{caller(1,1).first}: Coder#scalar(a,b,c) is deprecated" if $VERBOSE
27 27
        @tag, @scalar, _ = args
28 28
        @type = :scalar
29 29
      end
ext/psych/lib/psych/core_ext.rb
22 22
  def psych_yaml_as url
23 23
    return if caller[0].end_with?('rubytypes.rb')
24 24
    if $VERBOSE
25
      warn "#{caller[0]}: yaml_as is deprecated, please use yaml_tag"
25
      warn "#{caller(1,1).first}: yaml_as is deprecated, please use yaml_tag"
26 26
    end
27 27
    Psych.add_tag(url, self)
28 28
  end
ext/psych/lib/psych/deprecated.rb
10 10
  end
11 11

  
12 12
  def self.quick_emit thing, opts = {}, &block # :nodoc:
13
    warn "#{caller[0]}: YAML.quick_emit is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
13
    warn "#{caller(1,1).first}: YAML.quick_emit is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
14 14
    target = eval 'self', block.binding
15 15
    target.extend DeprecatedMethods
16 16
    metaclass = class << target; self; end
......
25 25
  # This method is deprecated, use Psych.load_stream instead.
26 26
  def self.load_documents yaml, &block
27 27
    if $VERBOSE
28
      warn "#{caller[0]}: load_documents is deprecated, use load_stream"
28
      warn "#{caller(1,1).first}: load_documents is deprecated, use load_stream"
29 29
    end
30 30
    list = load_stream yaml
31 31
    return list unless block_given?
......
33 33
  end
34 34

  
35 35
  def self.detect_implicit thing
36
    warn "#{caller[0]}: detect_implicit is deprecated" if $VERBOSE
36
    warn "#{caller(1,1).first}: detect_implicit is deprecated" if $VERBOSE
37 37
    return '' unless String === thing
38 38
    return 'null' if '' == thing
39 39
    ss = ScalarScanner.new(ClassLoader.new)
......
41 41
  end
42 42

  
43 43
  def self.add_ruby_type type_tag, &block
44
    warn "#{caller[0]}: add_ruby_type is deprecated, use add_domain_type" if $VERBOSE
44
    warn "#{caller(1,1).first}: add_ruby_type is deprecated, use add_domain_type" if $VERBOSE
45 45
    domain = 'ruby.yaml.org,2002'
46 46
    key = ['tag', domain, type_tag].join ':'
47 47
    @domain_types[key] = [key, block]
48 48
  end
49 49

  
50 50
  def self.add_private_type type_tag, &block
51
    warn "#{caller[0]}: add_private_type is deprecated, use add_domain_type" if $VERBOSE
51
    warn "#{caller(1,1).first}: add_private_type is deprecated, use add_domain_type" if $VERBOSE
52 52
    domain = 'x-private'
53 53
    key = [domain, type_tag].join ':'
54 54
    @domain_types[key] = [key, block]
55 55
  end
56 56

  
57 57
  def self.tagurize thing
58
    warn "#{caller[0]}: add_private_type is deprecated, use add_domain_type" if $VERBOSE
58
    warn "#{caller(1,1).first}: add_private_type is deprecated, use add_domain_type" if $VERBOSE
59 59
    return thing unless String === thing
60 60
    "tag:yaml.org,2002:#{thing}"
61 61
  end
62 62

  
63 63
  def self.read_type_class type, reference
64
    warn "#{caller[0]}: read_type_class is deprecated" if $VERBOSE
64
    warn "#{caller(1,1).first}: read_type_class is deprecated" if $VERBOSE
65 65
    _, _, type, name = type.split ':', 4
66 66

  
67 67
    reference = name.split('::').inject(reference) do |k,n|
......
71 71
  end
72 72

  
73 73
  def self.object_maker klass, hash
74
    warn "#{caller[0]}: object_maker is deprecated" if $VERBOSE
74
    warn "#{caller(1,1).first}: object_maker is deprecated" if $VERBOSE
75 75
    klass.allocate.tap do |obj|
76 76
      hash.each { |k,v| obj.instance_variable_set(:"@#{k}", v) }
77 77
    end
ext/psych/lib/psych/visitors/to_ruby.rb
382 382
          o.init_with c
383 383
        elsif o.respond_to?(:yaml_initialize)
384 384
          if $VERBOSE
385
            warn "Implementing #{o.class}#yaml_initialize is deprecated, please implement \"init_with(coder)\""
385
            warn "#{caller(1,1).first}: Implementing #{o.class}#yaml_initialize is deprecated, please implement \"init_with(coder)\""
386 386
          end
387 387
          o.yaml_initialize c.tag, c.map
388 388
        else
ext/psych/lib/psych/visitors/yaml_tree.rb
57 57
        return super if emitter && ss && options
58 58

  
59 59
        if $VERBOSE
60
          warn "This API is deprecated, please pass an emitter, scalar scanner, and options or call #{self}.create() (#{caller.first})"
60
          warn "#{caller(1,1).first}: This API is deprecated, please pass an emitter, scalar scanner, and options or call #{self}.create() (#{caller.first})"
61 61
        end
62 62
        create emitter, ss
63 63
      end
......
145 145
            if loc !~ /(syck\/rubytypes.rb|psych\/core_ext.rb)/
146 146
              unless target.respond_to?(:encode_with)
147 147
                if $VERBOSE
148
                  warn "implementing to_yaml is deprecated, please implement \"encode_with\""
148
                  warn "#{caller(1,1).first}: implementing to_yaml is deprecated, please implement \"encode_with\""
149 149
                end
150 150

  
151 151
                target.to_yaml(:nodump => true)
ext/win32/lib/Win32API.rb
2 2
# frozen_string_literal: true
3 3

  
4 4
# for backward compatibility
5
warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead" if $VERBOSE
5
warn "#{caller(1,1).first.sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead" if $VERBOSE
6 6

  
7 7
require 'fiddle/import'
8 8

  
lib/cgi/core.rb
260 260
  def _header_for_modruby(buf)  #:nodoc:
261 261
    request = Apache::request
262 262
    buf.scan(/([^:]+): (.+)#{EOL}/o) do |name, value|
263
      warn sprintf("name:%s value:%s\n", name, value) if $DEBUG
263
      warn sprintf("#{caller(0,1).first}: name:%s value:%s\n", name, value) if $DEBUG
264 264
      case name
265 265
      when 'Set-Cookie'
266 266
        request.headers_out.add(name, value)
lib/cmath.rb
50 50
    atanh
51 51
  ].each do |meth|
52 52
    define_method(meth + '!') do |*args, &block|
53
      warn("CMath##{meth}! is deprecated; use CMath##{meth} or Math##{meth}") if $VERBOSE
53
      warn("#{caller(1,1).first}: CMath##{meth}! is deprecated; use CMath##{meth} or Math##{meth}") if $VERBOSE
54 54
      RealMath.send(meth, *args, &block)
55 55
    end
56 56
  end
lib/delegate.rb
97 97
    target = self.__getobj__ {r = false}
98 98
    r &&= target.respond_to?(m, include_private)
99 99
    if r && include_private && !target.respond_to?(m, false)
100
      warn "#{caller(3)[0]}: delegator does not forward private method \##{m}"
100
      warn "#{caller(3,1).first}: delegator does not forward private method \##{m}"
101 101
      return false
102 102
    end
103 103
    r
lib/forwardable.rb
209 209
      method_call = "#{<<-"begin;"}\n#{<<-"end;".chomp}"
210 210
        begin;
211 211
          unless ::Kernel.instance_method(:respond_to?).bind(_).call(:"#{method}")
212
            ::Kernel.warn "\#{caller_locations(1)[0]}: "#{mesg.dump}"\#{_.class}"'##{method}'
212
            ::Kernel.warn "\#{caller_locations(1,1).first}: "#{mesg.dump}"\#{_.class}"'##{method}'
213 213
            _#{method_call}
214 214
          else
215 215
            _.#{method}(*args, &block)
lib/irb/locale.rb
31 31
        if @encoding_name
32 32
          begin load 'irb/encoding_aliases.rb'; rescue LoadError; end
33 33
          if @encoding = @@legacy_encoding_alias_map[@encoding_name]
34
            warn "%s is obsolete. use %s" % ["#{@lang}_#{@territory}.#{@encoding_name}", "#{@lang}_#{@territory}.#{@encoding.name}"]
34
            warn "#{caller(1,1).first}: %s is obsolete. use %s" % ["#{@lang}_#{@territory}.#{@encoding_name}", "#{@lang}_#{@territory}.#{@encoding.name}"]
35 35
          end
36 36
          @encoding = Encoding.find(@encoding_name) rescue nil
37 37
        end
lib/logger.rb
684 684
            begin
685 685
              check_shift_log
686 686
            rescue
687
              warn("log shifting failed. #{$!}")
687
              warn("#{caller(1,1).first}: log shifting failed. #{$!}")
688 688
            end
689 689
          end
690 690
          begin
691 691
            @dev.write(message)
692 692
          rescue
693
            warn("log writing failed. #{$!}")
693
            warn("#{caller(1,1).first}: log writing failed. #{$!}")
694 694
          end
695 695
        end
696 696
      rescue Exception => ignored
697
        warn("log writing failed. #{ignored}")
697
        warn("#{caller(1,1).first}: log writing failed. #{ignored}")
698 698
      end
699 699
    end
700 700

  
......
802 802
        rescue Errno::ENOENT
803 803
          # @filename file would not exist right after #rename and before #create_logfile
804 804
          if retry_limit <= 0
805
            warn("log rotation inter-process lock failed. #{$!}")
805
            warn("#{caller(1,1).first}: log rotation inter-process lock failed. #{$!}")
806 806
          else
807 807
            sleep retry_sleep
808 808
            retry_limit -= 1
......
811 811
          end
812 812
        end
813 813
      rescue
814
        warn("log rotation inter-process lock failed. #{$!}")
814
        warn("#{caller(1,1).first}: log rotation inter-process lock failed. #{$!}")
815 815
      end
816 816
    end
817 817

  
lib/mathn.rb
38 38
# class Numeric follows to make this documentation findable in a reasonable
39 39
# location
40 40

  
41
warn('lib/mathn.rb is deprecated') if $VERBOSE
41
warn("#{caller(0,1).first}: lib/mathn.rb is deprecated") if $VERBOSE
42 42

  
43 43
class Numeric; end
44 44

  
lib/matrix.rb
1246 1246
  # deprecated; use Matrix#determinant
1247 1247
  #
1248 1248
  def determinant_e
1249
    warn "#{caller(1)[0]}: warning: Matrix#determinant_e is deprecated; use #determinant"
1249
    warn "#{caller(1,1).first}: warning: Matrix#determinant_e is deprecated; use #determinant"
1250 1250
    determinant
1251 1251
  end
1252 1252
  alias det_e determinant_e
......
1304 1304
  # deprecated; use Matrix#rank
1305 1305
  #
1306 1306
  def rank_e
1307
    warn "#{caller(1)[0]}: warning: Matrix#rank_e is deprecated; use #rank"
1307
    warn "#{caller(1,1).first}: warning: Matrix#rank_e is deprecated; use #rank"
1308 1308
    rank
1309 1309
  end
1310 1310

  
......
1490 1490
  end
1491 1491

  
1492 1492
  def elements_to_f
1493
    warn "#{caller(1)[0]}: warning: Matrix#elements_to_f is deprecated, use map(&:to_f)"
1493
    warn "#{caller(1,1).first}: warning: Matrix#elements_to_f is deprecated, use map(&:to_f)"
1494 1494
    map(&:to_f)
1495 1495
  end
1496 1496

  
1497 1497
  def elements_to_i
1498
    warn "#{caller(1)[0]}: warning: Matrix#elements_to_i is deprecated, use map(&:to_i)"
1498
    warn "#{caller(1,1).first}: warning: Matrix#elements_to_i is deprecated, use map(&:to_i)"
1499 1499
    map(&:to_i)
1500 1500
  end
1501 1501

  
1502 1502
  def elements_to_r
1503
    warn "#{caller(1)[0]}: warning: Matrix#elements_to_r is deprecated, use map(&:to_r)"
1503
    warn "#{caller(1,1).first}: warning: Matrix#elements_to_r is deprecated, use map(&:to_r)"
1504 1504
    map(&:to_r)
1505 1505
  end
1506 1506

  
......
2122 2122
  end
2123 2123

  
2124 2124
  def elements_to_f
2125
    warn "#{caller(1)[0]}: warning: Vector#elements_to_f is deprecated"
2125
    warn "#{caller(1,1).first}: warning: Vector#elements_to_f is deprecated"
2126 2126
    map(&:to_f)
2127 2127
  end
2128 2128

  
2129 2129
  def elements_to_i
2130
    warn "#{caller(1)[0]}: warning: Vector#elements_to_i is deprecated"
2130
    warn "#{caller(1,1).first}: warning: Vector#elements_to_i is deprecated"
2131 2131
    map(&:to_i)
2132 2132
  end
2133 2133

  
2134 2134
  def elements_to_r
2135
    warn "#{caller(1)[0]}: warning: Vector#elements_to_r is deprecated"
2135
    warn "#{caller(1,1).first}: warning: Vector#elements_to_r is deprecated"
2136 2136
    map(&:to_r)
2137 2137
  end
2138 2138

  
lib/net/http.rb
683 683
    #   http.start { .... }
684 684
    #
685 685
    def set_debug_output(output)
686
      warn 'Net::HTTP#set_debug_output called after HTTP started' if started?
686
      warn "#{caller(1,1).first}: Net::HTTP#set_debug_output called after HTTP started" if started?
687 687
      @debug_output = output
688 688
    end
689 689

  
lib/net/http/generic_request.rb
82 82
  end
83 83

  
84 84
  def body_exist?
85
    warn "Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?" if $VERBOSE
85
    warn "#{caller(1,1).first}: Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?" if $VERBOSE
86 86
    response_body_permitted?
87 87
  end
88 88

  
......
299 299

  
300 300
  def supply_default_content_type
301 301
    return if content_type()
302
    warn 'net/http: warning: Content-Type did not set; using application/x-www-form-urlencoded' if $VERBOSE
302
    warn "#{caller(1,1).first}: net/http: warning: Content-Type did not set; using application/x-www-form-urlencoded" if $VERBOSE
303 303
    set_content_type 'application/x-www-form-urlencoded'
304 304
  end
305 305

  
lib/net/http/header.rb
14 14
    @header = {}
15 15
    return unless initheader
16 16
    initheader.each do |key, value|
17
      warn "net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE
17
      warn "#{caller(1,1).first}: net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE
18 18
      if value.nil?
19
        warn "net/http: warning: nil HTTP header: #{key}" if $VERBOSE
19
        warn "#{caller(1,1).first}: net/http: warning: nil HTTP header: #{key}" if $VERBOSE
20 20
      else
21 21
        @header[key.downcase] = [value.strip]
22 22
      end
lib/net/http/response.rb
138 138
  #
139 139

  
140 140
  def response   #:nodoc:
141
    warn "#{caller(1)[0]}: warning: Net::HTTPResponse#response is obsolete" if $VERBOSE
141
    warn "#{caller(1,1).first}: warning: Net::HTTPResponse#response is obsolete" if $VERBOSE
142 142
    self
143 143
  end
144 144

  
145 145
  def header   #:nodoc:
146
    warn "#{caller(1)[0]}: warning: Net::HTTPResponse#header is obsolete" if $VERBOSE
146
    warn "#{caller(1,1).first}: warning: Net::HTTPResponse#header is obsolete" if $VERBOSE
147 147
    self
148 148
  end
149 149

  
150 150
  def read_header   #:nodoc:
151
    warn "#{caller(1)[0]}: warning: Net::HTTPResponse#read_header is obsolete" if $VERBOSE
151
    warn "#{caller(1,1).first}: warning: Net::HTTPResponse#read_header is obsolete" if $VERBOSE
152 152
    self
153 153
  end
154 154

  
lib/rexml/cdata.rb
58 58
    #  c = CData.new( " Some text " )
59 59
    #  c.write( $stdout )     #->  <![CDATA[ Some text ]]>
60 60
    def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
61
      Kernel.warn( "#{self.class.name}.write is deprecated" )
61
      Kernel.warn( "#{caller(1,1).first}: #{self.class.name}.write is deprecated" )
62 62
      indent( output, indent )
63 63
      output << START
64 64
      output << @string
lib/rexml/comment.rb
48 48
    # ie_hack::
49 49
    #    Needed for conformity to the child API, but not used by this class.
50 50
    def write( output, indent=-1, transitive=false, ie_hack=false )
51
      Kernel.warn("Comment.write is deprecated.  See REXML::Formatters")
51
      Kernel.warn("#{caller(1,1).first}: Comment.write is deprecated.  See REXML::Formatters")
52 52
      indent( output, indent )
53 53
      output << START
54 54
      output << @string
lib/rexml/element.rb
686 686
    #  doc.write( out )     #-> doc is written to the string 'out'
687 687
    #  doc.write( $stdout ) #-> doc written to the console
688 688
    def write(output=$stdout, indent=-1, transitive=false, ie_hack=false)
689
      Kernel.warn("#{self.class.name}.write is deprecated.  See REXML::Formatters")
689
      Kernel.warn("#{caller(1,1).first}: #{self.class.name}.write is deprecated.  See REXML::Formatters")
690 690
      formatter = if indent > -1
691 691
          if transitive
692 692
            require "rexml/formatters/transitive"
lib/rexml/instruction.rb
43 43
    # See the rexml/formatters package
44 44
    #
45 45
    def write writer, indent=-1, transitive=false, ie_hack=false
46
      Kernel.warn( "#{self.class.name}.write is deprecated" )
46
      Kernel.warn( "#{caller(1,1).first}: #{self.class.name}.write is deprecated" )
47 47
      indent(writer, indent)
48 48
      writer << START.sub(/\\/u, '')
49 49
      writer << @target
lib/rexml/node.rb
26 26
    #   REXML::Formatters package for changing the output style.
27 27
    def to_s indent=nil
28 28
      unless indent.nil?
29
        Kernel.warn( "#{self.class.name}.to_s(indent) parameter is deprecated" )
29
        Kernel.warn( "#{caller(1,1).first}: #{self.class.name}.to_s(indent) parameter is deprecated" )
30 30
        f = REXML::Formatters::Pretty.new( indent )
31 31
        f.write( self, rv = "" )
32 32
      else
lib/rexml/text.rb
293 293
    # See REXML::Formatters
294 294
    #
295 295
    def write( writer, indent=-1, transitive=false, ie_hack=false )
296
      Kernel.warn("#{self.class.name}.write is deprecated.  See REXML::Formatters")
296
      Kernel.warn("#{caller(1,1).first}: #{self.class.name}.write is deprecated.  See REXML::Formatters")
297 297
      formatter = if indent > -1
298 298
          REXML::Formatters::Pretty.new( indent )
299 299
        else
lib/rss/rss.rb
596 596

  
597 597
      def #{accessor_name}=(*args)
598 598
        receiver = self.class.name
599
        warn("Warning:\#{caller.first.sub(/:in `.*'\z/, '')}: " \
599
        warn("Warning:\#{caller(1,1).first.sub(/:in `.*'\z/, '')}: " \
600 600
             "Don't use `\#{receiver}\##{accessor_name} = XXX'/" \
601 601
             "`\#{receiver}\#set_#{accessor_name}(XXX)'. " \
602 602
             "Those APIs are not sense of Ruby. " \
lib/tempfile.rb
124 124
  # If Tempfile.new cannot find a unique filename within a limited
125 125
  # number of tries, then it will raise an exception.
126 126
  def initialize(basename="", tmpdir=nil, mode: 0, **options)
127
    warn "Tempfile.new doesn't call the given block." if block_given?
127
    warn "#{caller(1,1).first}: Tempfile.new doesn't call the given block." if block_given?
128 128

  
129 129
    @unlinked = false
130 130
    @mode = mode|File::RDWR|File::CREAT|File::EXCL
......
250 250
    def call(*args)
251 251
      return if @pid != Process.pid
252 252

  
253
      warn "removing #{@tmpfile.path}..." if $DEBUG
253
      warn "#{caller(1,1).first}: removing #{@tmpfile.path}..." if $DEBUG
254 254

  
255 255
      @tmpfile.close unless @tmpfile.closed?
256 256
      begin
......
258 258
      rescue Errno::ENOENT
259 259
      end
260 260

  
261
      warn "done" if $DEBUG
261
      warn "#{caller(1,1).first}: done" if $DEBUG
262 262
    end
263 263
  end
264 264

  
lib/uri/common.rb
100 100
    #   # => "@%3F@%21"
101 101
    #
102 102
    def escape(*arg)
103
      warn "#{caller(1)[0]}: warning: URI.escape is obsolete" if $VERBOSE
103
      warn "#{caller(1,1).first}: warning: URI.escape is obsolete" if $VERBOSE
104 104
      DEFAULT_PARSER.escape(*arg)
105 105
    end
106 106
    alias encode escape
......
126 126
    #   # => "http://example.com/?a=\t\r"
127 127
    #
128 128
    def unescape(*arg)
129
      warn "#{caller(1)[0]}: warning: URI.unescape is obsolete" if $VERBOSE
129
      warn "#{caller(1,1).first}: warning: URI.unescape is obsolete" if $VERBOSE
130 130
      DEFAULT_PARSER.unescape(*arg)
131 131
    end
132 132
    alias decode unescape
......
294 294
  #   # => ["http://foo.example.com/bla", "mailto:test@example.com"]
295 295
  #
296 296
  def self.extract(str, schemes = nil, &block)
297
    warn "#{caller(1)[0]}: warning: URI.extract is obsolete" if $VERBOSE
297
    warn "#{caller(1,1).first}: warning: URI.extract is obsolete" if $VERBOSE
298 298
    DEFAULT_PARSER.extract(str, schemes, &block)
299 299
  end
300 300

  
......
330 330
  #   end
331 331
  #
332 332
  def self.regexp(schemes = nil)
333
    warn "#{caller(1)[0]}: warning: URI.regexp is obsolete" if $VERBOSE
333
    warn "#{caller(1,1).first}: warning: URI.regexp is obsolete" if $VERBOSE
334 334
    DEFAULT_PARSER.make_regexp(schemes)
335 335
  end
336 336

  
lib/uri/generic.rb
1526 1526
      elsif name == 'http_proxy'
1527 1527
        unless proxy_uri = env[name]
1528 1528
          if proxy_uri = env[name.upcase]
1529
            warn 'The environment variable HTTP_PROXY is discouraged.  Use http_proxy.'
1529
            warn "#{caller(1,1).first}: The environment variable HTTP_PROXY is discouraged.  Use http_proxy."
1530 1530
          end
1531 1531
        end
1532 1532
      else
lib/webrick/utils.rb
37 37
        Process::Sys::setgid(pw.gid)
38 38
        Process::Sys::setuid(pw.uid)
39 39
      else
40
        warn("WEBrick::Utils::su doesn't work on this platform")
40
        warn("#{caller(1,1).first}: WEBrick::Utils::su doesn't work on this platform")
41 41
      end
42 42
    end
43 43
    module_function :su
lib/yaml.rb
5 5
begin
6 6
  require 'psych'
7 7
rescue LoadError
8
  warn "#{caller[0]}:"
9
  warn "It seems your ruby installation is missing psych (for YAML output)."
10
  warn "To eliminate this warning, please install libyaml and reinstall your ruby."
8
  warn <<-eowarn
9
#{caller(1,1).first}
10
It seems your ruby installation is missing psych (for YAML output).
11
To eliminate this warning, please install libyaml and reinstall your ruby.
12
  eowarn
11 13
  raise
12 14
end
13 15

  
test/logger/test_logdevice.rb
86 86
      logdev.close
87 87
      $stderr, stderr = stderr, $stderr
88 88
    end
89
    assert_equal "log writing failed. disk is full\n", stderr
89
    assert_include stderr, "log writing failed. disk is full\n"
90 90
  end
91 91

  
92 92
  def test_close
93
-