Sha256: ed34cdea0fa45be0ab53e08559c106b8a171e03ff7fbf51c2f7c7ca75f257bea
Contents?: true
Size: 585 Bytes
Versions: 26
Compression:
Stored size: 585 Bytes
Contents
module Kernel # Like #warn produces the current line number as well. # # warn_with_line("You have been warned.") # # _produces_ # # 3: Warning: You have been warned. # # Note that this method depends on the output of #caller. def warn_with_line(msg="", fulltrace=nil) trace = caller(1) where = trace[0].sub(/:in.*/,'') STDERR.puts "#{where}: Warning: #{msg}" STDERR.puts trace.map { |t| "\tfrom #{t}" } if fulltrace end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # TODO
Version data entries
26 entries across 26 versions & 1 rubygems