naughty-step 0.0.1 → 0.0.2
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.
- data/naughty_step.gemspec +2 -2
- data/naughty_step.rb +6 -0
- metadata +5 -5
data/naughty_step.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'naughty-step'
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.2"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.summary = "A Rack middleware for simple 404 and 500 status handling"
|
6
|
-
s.description = "Just create your 404 and 500 html pages, use the middleware, and that's it."
|
6
|
+
s.description = "A Rack middleware for simple 404 and 500 status handling. Just create your 404 and 500 html pages, use the middleware, and that's it."
|
7
7
|
s.files = `git ls-files`.split("\n").sort
|
8
8
|
s.test_files = ['spec.rb']
|
9
9
|
s.require_path = '.'
|
data/naughty_step.rb
CHANGED
@@ -15,8 +15,14 @@ module Rack
|
|
15
15
|
end
|
16
16
|
[status,headers,body]
|
17
17
|
rescue StandardError, LoadError, SyntaxError => e
|
18
|
+
# Log like on ::Rack::ShowExceptions
|
19
|
+
env["rack.errors"].puts "#{e.class}: #{e.message}"
|
20
|
+
env["rack.errors"].puts e.backtrace.map { |l| "\t" + l }
|
21
|
+
env["rack.errors"].flush
|
22
|
+
# Prepare 500 page
|
18
23
|
body = F.read(@loc_error)
|
19
24
|
headers = {'Content-Type' => 'text/html', 'Content-Length' => body.size.to_s}
|
25
|
+
# Render
|
20
26
|
[500, headers, body]
|
21
27
|
end
|
22
28
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: naughty-step
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mickael Riga
|
@@ -15,11 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-30 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
22
|
-
description: Just create your 404 and 500 html pages, use the middleware, and that's it.
|
22
|
+
description: A Rack middleware for simple 404 and 500 status handling. Just create your 404 and 500 html pages, use the middleware, and that's it.
|
23
23
|
email: mig@mypeplum.com
|
24
24
|
executables: []
|
25
25
|
|