Class: PrettyDebug
Class Method Summary collapse
Class Method Details
.backtrace_locations(e) ⇒ Object
51 52 53 54 |
# File 'lib/pretty_debug.rb', line 51 def self.backtrace_locations e e.complement_backtrace_locations caller_locations(e.backtrace_locations) end |
.caller_locations(a) ⇒ Object
55 56 57 58 59 |
# File 'lib/pretty_debug.rb', line 55 def self.caller_locations a a .map{|l| [l.path, l.lineno, l.base_label]} .transpose.tap{|_, _, m| m[-1] = ""; m.rotate!(-1)}.transpose end |
.message(e) ⇒ Object
47 48 49 50 |
# File 'lib/pretty_debug.rb', line 47 def self. e e.complement_backtrace_locations e..dup.tap{|s| s[0] = s[0].upcase unless s.empty?}.sub(/(?<=[^.])\z/, ".") end |