better_errors 0.0.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,234 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%= exception.class %> at <%= request_path %></title>
5
- <style>
6
- * {
7
- margin:0;
8
- padding:0;
9
- }
10
- body {
11
- font-family:Verdana, sans-serif;
12
- margin:0;
13
- font-size:13px;
14
- }
15
- header {
16
- padding:32px 32px;
17
- border-bottom:1px solid #ea6756;
18
- background-color: #ffe5e7;
19
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffe5e7), to(#ffb2b8)); /* Safari 4+, Chrome */
20
- background-image: -webkit-linear-gradient(top, #ffe5e7, #ffb2b8); /* Chrome 10+, Safari 5.1+, iOS 5+ */
21
- background-image: -moz-linear-gradient(top, #ffe5e7, #ffb2b8); /* Firefox 3.6-15 */
22
- background-image: -o-linear-gradient(top, #ffe5e7, #ffb2b8); /* Opera 11.10-12.00 */
23
- background-image: linear-gradient(to bottom, #ffe5e7, #ffb2b8); /* Firefox 16+, IE10, Opera 12.50+ */
24
- }
25
- h2 {
26
- font-weight:normal;
27
- margin:0;
28
- margin-bottom:16px;
29
- }
30
- h2 span {
31
- color:#666666;
32
- }
33
- header table {
34
- border-collapse:collapse;
35
- }
36
- header table th {
37
- text-align:right;
38
- font-weight:bold;
39
- padding-right:12px;
40
- }
41
- header table th, header table td {
42
- padding:4px 6px;
43
- }
44
- .frames {
45
- width:50%;
46
- float:left;
47
- }
48
- .frames li {
49
- list-style:none;
50
- display:block;
51
- padding:12px;
52
- overflow:hidden;
53
- cursor:pointer;
54
- background-color: #f4f7ff;
55
- background-image: -webkit-gradient(linear, left top, left bottom, from(#f4f7ff), to(#e4ebfe)); /* Safari 4+, Chrome */
56
- background-image: -webkit-linear-gradient(top, #f4f7ff, #e4ebfe); /* Chrome 10+, Safari 5.1+, iOS 5+ */
57
- background-image: -moz-linear-gradient(top, #f4f7ff, #e4ebfe); /* Firefox 3.6-15 */
58
- background-image: -o-linear-gradient(top, #f4f7ff, #e4ebfe); /* Opera 11.10-12.00 */
59
- background-image: linear-gradient(to bottom, #f4f7ff, #e4ebfe); /* Firefox 16+, IE10, Opera 12.50+ */
60
- border-bottom:1px solid #cccccc;
61
- }
62
- .frames li:hover, .frames li.selected {
63
- background-color: #e4ebfe;
64
- background-image: -webkit-gradient(linear, left top, left bottom, from(#e4ebfe), to(#c2d3fe)); /* Safari 4+, Chrome */
65
- background-image: -webkit-linear-gradient(top, #e4ebfe, #c2d3fe); /* Chrome 10+, Safari 5.1+, iOS 5+ */
66
- background-image: -moz-linear-gradient(top, #e4ebfe, #c2d3fe); /* Firefox 3.6-15 */
67
- background-image: -o-linear-gradient(top, #e4ebfe, #c2d3fe); /* Opera 11.10-12.00 */
68
- background-image: linear-gradient(to bottom, #e4ebfe, #c2d3fe); /* Firefox 16+, IE10, Opera 12.50+ */
69
- }
70
- .frames .name, .frame_info h2.name {
71
- font-family:Monaco, Incosolata, Consolas, monospace;
72
- font-size:14px;
73
- margin-bottom:4px;
74
- }
75
- .location {
76
- color:#888888;
77
- }
78
- .location .filename, .location .line {
79
- color:#333333;
80
- }
81
- .frame_info {
82
- background-color:#efefef;
83
- border-bottom:1px solid #cccccc;
84
- float:left;
85
- width:50%;
86
- }
87
- .frame_info > * {
88
- margin:16px;
89
- }
90
- .frame_info h2 {
91
- font-family:Monaco, Incosolata, Consolas, monospace;
92
- }
93
- .frame_info .code {
94
- font-family:Monaco, Incosolata, Consolas, monospace;
95
- background-color:#ffffff;
96
- border:1px solid #cccccc;
97
- border-collapse:collapse;
98
- overflow:auto;
99
- }
100
- .frame_info .code pre:nth-child(2n+1) {
101
- background-color:#f9f9f9;
102
- }
103
- .frame_info .code pre:nth-child(2n) {
104
- background-color:#f3f3f3;
105
- }
106
- .frame_info .code pre.highlight {
107
- background-color:#ffeaaa;
108
- }
109
- .frame_info .code .line {
110
- text-align:right;
111
- padding-right:12px;
112
- padding-left:0px;
113
- }
114
- code {
115
- background-color:#f0f0f0;
116
- padding:2px 4px;
117
- border:1px solid #d0d0d0;
118
- }
119
- h3 {
120
- font-weight:normal;
121
- border-top:1px solid #cccccc;
122
- padding-top:16px;
123
- }
124
- .var_table {
125
- border-collapse:collapse;
126
- }
127
- .var_table td {
128
- padding:8px;
129
- }
130
- .var_table td.name {
131
- font-style:italic;
132
- }
133
- .var_table tr {
134
- border-bottom:1px solid #cccccc;
135
- }
136
- </style>
137
- </head>
138
- <body>
139
- <header>
140
- <h2><%= exception.class %> <span>at <%= request_path %></span></h2>
141
- <table>
142
- <tr>
143
- <th>Message</th>
144
- <td><%= exception.message %></td>
145
- </tr>
146
- <% if backtrace_frames.any? %>
147
- <tr>
148
- <th>File</th>
149
- <td><%= backtrace_frames.first.filename %></td>
150
- </tr>
151
- <tr>
152
- <th>Line</th>
153
- <td><%= backtrace_frames.first.line %></td>
154
- </tr>
155
- <% end %>
156
- </table>
157
- </header>
158
- <section class="backtrace">
159
- <ul class="frames">
160
- <% backtrace_frames.each_with_index do |frame, index| %>
161
- <li
162
- data-context="<%= frame.context %>"
163
- data-full-filename="<%= frame.filename %>"
164
- data-filename="<%= frame.pretty_path %>"
165
- data-line="<%= frame.line %>"
166
- data-name="<%= frame.name %>"
167
- data-index="<%= index %>"
168
- >
169
- <div class="name"><%= frame.name %></div>
170
- <div class="location"><span class="filename"><%= frame.pretty_path %></span>, line <span class="line"><%= frame.line %></span></div>
171
- </li>
172
- <% end %>
173
- </ul>
174
- <% backtrace_frames.each_with_index do |frame, index| %>
175
- <div class="frame_info" id="frame_info_<%= index %>" style="display:none;">
176
- <h2 class="name"><%= frame.name %></h2>
177
- <div class="location"><span class="filename"><%= frame.pretty_path %></span>, line <span class="line"><%= frame.line %></span></div>
178
- <%== highlighted_code_block frame %>
179
-
180
- <h3>Local Variables</h3>
181
- <table class="var_table">
182
- <% frame.local_variables.each do |name, value| %>
183
- <tr><td class="name"><%= name %></td><td><pre><%= value.inspect %></pre></td></tr>
184
- <% end %>
185
- </table>
186
-
187
- <h3>Instance Variables</h3>
188
- <table class="var_table">
189
- <% frame.instance_variables.each do |name, value| %>
190
- <tr><td class="name"><%= name %></td><td><pre><%= value.inspect %></pre></td></tr>
191
- <% end %>
192
- </table>
193
- </div>
194
- <% end %>
195
- <div style="clear:both"></div>
196
- </section>
197
- </body>
198
- <script>
199
- (function() {
200
- var previous = null;
201
- var previousFrameInfo = null;
202
- var frames = document.querySelectorAll("ul.frames li");
203
-
204
- var header = document.querySelector("header");
205
- var headerHeight = header.offsetHeight;
206
-
207
- function selectFrameInfo(index) {
208
- var el = document.getElementById("frame_info_" + index);
209
-
210
- if(previousFrameInfo) {
211
- previousFrameInfo.style.display = "none";
212
- }
213
- previousFrameInfo = el;
214
- previousFrameInfo.style.display = "block";
215
- }
216
-
217
- for(var i = 0; i < frames.length; i++) {
218
- (function(el) {
219
- el.onclick = function() {
220
- if(previous) {
221
- previous.className = "";
222
- }
223
- el.className = "selected";
224
- previous = el;
225
-
226
- selectFrameInfo(el.attributes["data-index"].value);
227
- };
228
- })(frames[i]);
229
- }
230
-
231
- document.querySelector(".frames li:first-child").click();
232
- })();
233
- </script>
234
- </html>