Changeset 819

Show
Ignore:
Timestamp:
11/02/07 22:11:08 (1 year ago)
Author:
e.@brainspl.at
Message:

fix default internalservererror template to work on windows, closes #217

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app_generators/merb/templates/app/views/exceptions/internal_server_error.html.erb

    r640 r819  
    142142                                                </td> 
    143143                                                <td class="path"> 
    144                                                         <%= (line.match(/^([^:]+)/)[1] rescue 'unknown').sub(/\/((opt|usr)\/local\/lib\/(ruby\/)?(gems\/)?(1.8\/)?(gems\/)?|.+\/app\/)/, '') %> in "<strong><%= line.match(/:in `(.+)'$/)[1] rescue '?' %></strong>" 
     144                                                        <%  file, lineno, in_exists, method = ( line.match(/^(.+):(\d+):(in) `(.+)'/) || line.match(/^(.+):(\d+)/) ).to_a[1..-1] %> 
     145                                                        <%= file rescue line %> 
     146                                                        <% if in_exists %> 
     147                                                                in "<strong><%=method %></strong>" 
     148                                                        <% end %> 
    145149                                                </td> 
    146150                                                <td class="line"> 
    147                                                         <a href="txmt://open?url=file://<%=file = (line.match(/^([^:]+)/)[1] rescue 'unknown')%>&amp;line=<%= lineno = line.match(/:([0-9]+):/)[1] rescue '?' %>"><%=lineno%></a> 
     151                                                        <a href="txmt://open?url=file://<%=file rescue 'unknown' %>&amp;line=<%= lineno rescue '?' %>"><%=lineno%></a> 
    148152                                                </td>  
    149153                                        </tr> 
     
    153157                                                <td class="code" colspan="2"><% (__caller_lines__(file, lineno, 5) rescue []).each do |llineno, lcode, lcurrent| %> 
    154158<a href="txmt://open?url=file://<%=file%>&amp;line=<%=llineno%>"><%= llineno %></a><%='<em>' if llineno==lineno.to_i %><%= lcode.size > 90 ? lcode[0..90]+'<span class="more">......</span>' : lcode %><%='</em>' if llineno==lineno.to_i %> 
    155 <% end %> 
     159                                               <% end %> 
    156160 
    157161</td>