Module: CoreEx::Exception
- Included in:
- Exception
- Defined in:
- lib/core_ex/exception.rb
Instance Method Summary collapse
-
#long_pp ⇒ Object
FIXME: write a ruby_pp which print exception backtrace exactly as ruby does by cuting long and repetitive backtrace.
- #short_pp ⇒ Object
- #tiny_pp ⇒ Object
Instance Method Details
#long_pp ⇒ Object
FIXME: write a ruby_pp which print exception backtrace exactly as ruby does
by cuting long and repetitive backtrace.
13 14 15 16 17 18 |
# File 'lib/core_ex/exception.rb', line 13 def long_pp str = short_pp + "\n" backtrace[1..-1].each { |x| str += " from #{x}\n" } if backtrace str.chomp! str end |
#short_pp ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/core_ex/exception.rb', line 20 def short_pp if backtrace.nil? tiny_pp else "#{backtrace[0]}: #{tiny_pp}" end end |
#tiny_pp ⇒ Object
28 29 30 31 |
# File 'lib/core_ex/exception.rb', line 28 def tiny_pp exc_name = inspect.sub(/^#<(\w+):.+$/, '\1') "#{self} (#{exc_name})" end |