Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 2773

Show
Ignore:
Timestamp:
10/27/05 21:58:39 (3 years ago)
Author:
ulysses
Message:

Fix line number detection and escape RAILS_ROOT in backtrace Regexp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r2772 r2773  
    11*SVN* 
     2 
     3* Fix line number detection and escape RAILS_ROOT in backtrace Regexp [Nicholas Seckar] 
    24 
    35* Fixed document.getElementsByClassName from Prototype to be speedy again [Sam Stephenson] 
  • trunk/actionpack/lib/action_controller/templates/rescues/_trace.rhtml

    r2769 r2773  
    55    ["Full Trace", @exception.clean_backtrace] 
    66  ] 
    7   if defined?(RAILS_ROOT) 
    8     traces.each { |name, trace| trace.map! { |p| p.gsub(/^(?:\.\/)?#{RAILS_ROOT}/, '<b>#{RAILS_ROOT}</b>') } } 
    9   end 
    107  names = traces.collect {|name, trace| name} 
    118%> 
  • trunk/actionpack/lib/action_view/template_error.rb

    r2655 r2773  
    4848    def line_number 
    4949      if file_name 
    50         regexp = /#{Regexp.escape File.basename(file_name)}:(\d+)\s*$
     50        regexp = /#{Regexp.escape File.basename(file_name)}:(\d+)
    5151        [@original_exception.message, @original_exception.clean_backtrace].flatten.each do |line| 
    5252          return $1.to_i if regexp =~ line 
     
    8484 
    8585Exception::TraceSubstitutions << [/:in\s+`_run_(html|xml).*'\s*$/, ''] if defined?(Exception::TraceSubstitutions) 
     86Exception::TraceSubstitutions << [%r{^\s*#{Regexp.escape RAILS_ROOT}}, '#{RAILS_ROOT}'] if defined?(RAILS_ROOT)