Module: Footnotes::Extensions::Exception
- Defined in:
- lib/rails-footnotes/backtracer.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 |
# File 'lib/rails-footnotes/backtracer.rb', line 4 def self.included(base) base.class_eval do alias_method_chain :clean_backtrace, :links end end |
Instance Method Details
#add_links_to_backtrace(lines) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rails-footnotes/backtracer.rb', line 10 def add_links_to_backtrace(lines) lines.collect do |line| = line.gsub('#{RAILS_ROOT}', RAILS_ROOT) if match = .match(/^(.+):(\d+):in/) || match = .match(/^(.+):(\d+)\s*$/) file = File.(match[1]) line_number = match[2] html = %[<a href="#{Footnotes::Filter.prefix(file, line_number, 1)}">#{line}</a>] else line end end end |