Module: ABRT::Exception
- Defined in:
- lib/abrt/exception.rb
Instance Method Summary collapse
-
#executable ⇒ Object
Obtains executable name from backtrace.
-
#format ⇒ Object
Provides the exception formated in the same way as Ruby does for standard error output.
Instance Method Details
#executable ⇒ Object
Obtains executable name from backtrace. This should be more reliable then use of $0 aka $PROGRAM_NAME.
15 16 17 |
# File 'lib/abrt/exception.rb', line 15 def executable backtrace && backtrace.last && backtrace.last[/(.*?):/, 1] || $PROGRAM_NAME end |
#format ⇒ Object
Provides the exception formated in the same way as Ruby does for standard error output.
7 8 9 10 11 |
# File 'lib/abrt/exception.rb', line 7 def format backtrace = self.backtrace.collect { |line| "\tfrom #{line}" } backtrace[0] = "#{self.backtrace.first}: #{self.} (#{self.class.name})" backtrace end |