rackr 0.0.51 → 0.0.53
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.
- checksums.yaml +4 -4
- data/lib/rackr/router/errors/dev_html.rb +32 -31
- data/lib/rackr/router.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 207a61eead2347b17a9f17c396934954640a8658ebede9625ad62e05e2db9465
|
4
|
+
data.tar.gz: e8e7c162619f150483c1c1000f4cfff16a65cc68596871d9f034c9d6fcdf5e1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b5c019b83ffd983b74a35b07588d190f64c1ac01e1c7efffd9cc5595d5901f653878c5ad3ba2496b4557841d12a0886cdab68d9eda262604290a73345474c00
|
7
|
+
data.tar.gz: c3b6d38fa59027763530fe14f1e4630fe78de3aa568c7e998d93725e06bb3f30308be706fa26f5c30cf2fe5d32c568065f39617dd1db4d4a7222d9558a6068a6
|
@@ -9,37 +9,34 @@ class Rackr
|
|
9
9
|
html do
|
10
10
|
tag :head do
|
11
11
|
title 'Application error'
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
padding: 0em 2em;
|
30
|
-
border: 5px solid #ffffff;
|
31
|
-
border-radius: 1em;
|
32
|
-
}
|
33
|
-
h1 {
|
34
|
-
background-color: #464646;
|
35
|
-
padding: 1em;
|
36
|
-
border-radius: 0.2em;
|
37
|
-
}
|
38
|
-
)
|
12
|
+
_ %q(<style>
|
13
|
+
html * { padding:0; margin:0; }
|
14
|
+
body * { padding:10px 20px; }
|
15
|
+
body * * { padding:0; }
|
16
|
+
body { font:small sans-serif; }
|
17
|
+
body>div { border-bottom:1px solid #ddd; }
|
18
|
+
h1 { font-weight:normal; }
|
19
|
+
h2 { margin-bottom:.8em; }
|
20
|
+
h2 span { font-size:80%; color:#666; font-weight:normal; }
|
21
|
+
#summary { background: #ffc; }
|
22
|
+
#summary h2 { font-weight: normal; color: #666; }
|
23
|
+
pre {
|
24
|
+
background: #f8f8f8;
|
25
|
+
padding: 1em;
|
26
|
+
margin-bottom: 1em;
|
27
|
+
}
|
28
|
+
</style>)
|
39
29
|
end
|
40
30
|
tag :body do
|
41
|
-
div do
|
42
|
-
h1 env['error'].
|
31
|
+
div id: 'summary' do
|
32
|
+
h1 env['error'].class.to_s
|
33
|
+
if env['error'].message.size > 1000
|
34
|
+
h2 "#{env['error'].message.slice(0, 1000)} ..."
|
35
|
+
else
|
36
|
+
h2 env['error'].message
|
37
|
+
end
|
38
|
+
end
|
39
|
+
div id: 'backtrace' do
|
43
40
|
backtrace(env)
|
44
41
|
end
|
45
42
|
end
|
@@ -48,8 +45,13 @@ class Rackr
|
|
48
45
|
|
49
46
|
def backtrace(env)
|
50
47
|
first, *tail = env['error'].backtrace
|
48
|
+
h2 do
|
49
|
+
_ 'Traceback '
|
50
|
+
span '(innermost first)'
|
51
|
+
end
|
51
52
|
|
52
53
|
tag :p, first, class: "first-p"
|
54
|
+
br
|
53
55
|
|
54
56
|
line_number = extract_line_number(first)
|
55
57
|
match = first.match(%r{^(\/[\w\/.-]+)})
|
@@ -64,10 +66,9 @@ class Rackr
|
|
64
66
|
"#{i+1}: #{line} \n"
|
65
67
|
end
|
66
68
|
|
67
|
-
tag :pre, slice_around_index(lines, line_number).join("")
|
69
|
+
tag :pre, slice_around_index(lines, line_number).join("").chomp
|
68
70
|
end
|
69
71
|
|
70
|
-
hr
|
71
72
|
tag :p, tail.join("\n")
|
72
73
|
end
|
73
74
|
|
data/lib/rackr/router.rb
CHANGED
@@ -72,7 +72,7 @@ class Rackr
|
|
72
72
|
rescue Rackr::NotFound
|
73
73
|
call_endpoint(@not_found, request_builder.call)
|
74
74
|
rescue Exception => e
|
75
|
-
return @error.call(request_builder.call, e)
|
75
|
+
return @error.call(request_builder.call, e) if !@dev_mode || ENV['RACKR_ERROR_DEV']
|
76
76
|
|
77
77
|
call_endpoint(Errors::DevHtml, env.merge({'error' => e}))
|
78
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rackr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique F. Teixeira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubi
|