Method: RMTools.format_trace_to_html

Defined in:
lib/rmtools/dev/trace_format.rb

.format_trace_to_html(a) ⇒ Object

disclaimer: Firefox (at least 3.6+) on Windoze does not allow to use file:// protocol T_T



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/rmtools/dev/trace_format.rb', line 70

def format_trace_to_html(a)
  a.map! do |lines|
    caller_string, snippet = lines/"\n"
    caler = caller_string.parse(:caller)
    if caler
      path = caler.path
      lines = ["<a href='#{CGI.escape 'file://'+path}'>#{path}</a>:#{caler.line} in #{caler.func}"]
      lines << RMTools::Painter.clean(snippet) if snippet
      lines * "\n"
    else
      lines
    end
  end
end