Method: Ruber::ExceptionDialog::ExceptionBacktraceWidget#initialize
- Defined in:
- lib/ruber/exception_widgets.rb
#initialize(ex, parent = nil) ⇒ ExceptionBacktraceWidget
Returns a new instance of ExceptionBacktraceWidget.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ruber/exception_widgets.rb', line 50 def initialize ex, parent = nil super parent self.line_wrap_mode = NoWrap self.read_only = true #Replace < and > with the corresponding HTML entities in the message msg = ex..gsub(/[<>]/){|s| s == '<' ? '<' : '>'} #Replace < and > with the corresponding HTML entities in the backtrace backtrace = ex.backtrace.map{|l| l.gsub(/[<>]/){|s| s == '<' ? '<' : '>'}} text = "<tt>#{msg}<br/>#{backtrace.join '<br/>'}</tt>" self.html = text end |