Formats backtraces so they’re clickable by TextMate
# File lib/rspec/core/formatters/text_mate_formatter.rb, line 9 9: def backtrace_line(line, skip_textmate_conversion=false) 10: if skip_textmate_conversion 11: super(line) 12: else 13: format_backtrace_line_for_textmate(super(line)) 14: end 15: end
# File lib/rspec/core/formatters/text_mate_formatter.rb, line 24 24: def extra_failure_content(exception) 25: require 'rspec/core/formatters/snippet_extractor' 26: backtrace = exception.backtrace.map {|line| backtrace_line(line, :skip_textmate_conversion)} 27: backtrace.compact! 28: @snippet_extractor ||= SnippetExtractor.new 29: " <pre class=\"ruby\"><code>#{@snippet_extractor.snippet(backtrace)}</code></pre>" 30: end
# File lib/rspec/core/formatters/text_mate_formatter.rb, line 17 17: def format_backtrace_line_for_textmate(line) 18: return nil unless line 19: CGI.escapeHTML(line).sub(/([^:]*\.e?rb):(\d*)/) do 20: "<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> " 21: end 22: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.