public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Update error trace templates

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2677 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Nicholas Seckar (author)
Tue Oct 18 07:08:05 -0700 2005
commit  7d8ecad127c8e7b2ffcab883c71e16414a4261c2
tree    7831c80fade6185796a94d799f06487fe39b8775
parent  60b6fac5deec3317acaca8dc3d399faea25223b2
...
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
0
@@ -1,3 +1,7 @@
0
+* Update error trace templates [Nicholas Seckar]
0
+
0
+* Stop showing generated routing code in application traces [Nicholas Seckar]
0
+
0
 *1.10.0* (October 16th, 2005)
0
 
0
 * Make string-keys locals assigns optional. Add documentation describing depreciated state [skaes@web.de]
...
1
2
3
4
5
6
7
8
 
 
 
 
 
 
9
10
11
12
13
14
15
16
17
 
 
 
 
 
 
 
 
 
 
 
18
19
20
21
...
 
 
1
 
 
 
 
 
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
0
@@ -1,22 +1,25 @@
0
-
0
-<% if @exception %>
0
 <%
0
- clean_backtrace = @exception.clean_backtrace
0
- app_trace = @exception.application_backtrace
0
- framework_trace = clean_backtrace - app_trace
0
- traces = {"Application Trace" => app_trace, "Framework Trace" => framework_trace, "Full Trace" => clean_backtrace}
0
- trace_names = ["Application Trace", "Framework Trace", "Full Trace"]
0
+ traces = [
0
+ ["Application Trace", @exception.application_backtrace],
0
+ ["Framework Trace", @exception.framework_backtrace],
0
+ ["Full Trace", @exception.clean_backtrace]
0
+ ]
0
+ names = traces.collect {|name, trace| name}
0
 %>
0
 
0
 <div id="traces">
0
- <% trace_names.each do |k| -%>
0
- <div id="<%= k.gsub /\s/, '-' %>" style="display: <%= k == "Application Trace" ? 'block' : 'none' %>;">
0
- <% trace_names.each do |ok| -%>
0
- <a href="#" onclick="document.getElementById('<%= k.gsub /\s/, '-' %>').style.display='none'; document.getElementById('<%= ok.gsub /\s/, '-' %>').style.display='block'; return false;"><%= ok %></a> <%= '|' unless trace_names.last == ok %>
0
- <% end -%>
0
- <pre><code><%= traces[k].join "\n" %></code></pre>
0
+ <% names.each do |name| -%>
0
+ <%
0
+ show = "document.getElementById('#{name.gsub /\s/, '-'}').style.display='block';"
0
+ hide = (names - [name]).collect {|hide_name| "document.getElementById('#{hide_name.gsub /\s/, '-'}').style.display='none';"}
0
+ %>
0
+ <a href="#" onclick="<%= hide %><%= show %>; return false;"><%= name %></a> <%= '|' unless names.last == name %>
0
+ <% end -%>
0
+
0
+ <% traces.each do |name, trace| -%>
0
+ <div id="<%= name.gsub /\s/, '-' %>" style="display: <%= name == "Application Trace" ? 'block' : 'none' %>;">
0
+ <pre><code><%= trace.join "\n" %></code></pre>
0
     </div>
0
   <% end -%>
0
 </div>
0
-<% end %>

Comments

    No one has commented yet.