utopia 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54d9c31ecb199e89107637d08ff6b4d9f1cee359
|
4
|
+
data.tar.gz: 6a0e26e2670269546150f852e2ed40b39bf74f25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67071fd637552a90378c0e56562600e6ae5fd501001891bc6eaeefba58dbfc8f6362c510478cb2958d57c97f8dc8ddd1b4cbb9ed3a6ab3cbf8a197f853fdc30d
|
7
|
+
data.tar.gz: a172e3bef577d33ed6466b5532ed78ef8d8b9086e3d27e2dd8164d071126560ec403dd8745d182530465835fb8d41f13e9bdd5a6c088a3291fac13676b0de054
|
@@ -46,7 +46,9 @@ module Utopia
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def redirect(env, exception)
|
49
|
-
|
49
|
+
response = @app.call(env.merge('PATH_INFO' => @location, 'REQUEST_METHOD' => 'GET'))
|
50
|
+
|
51
|
+
return [500, response[1], response[2]]
|
50
52
|
end
|
51
53
|
|
52
54
|
def call(env)
|
data/lib/utopia/version.rb
CHANGED
@@ -33,10 +33,17 @@ module Utopia::ExceptionHandlerSpec
|
|
33
33
|
let(:app) {Rack::Builder.parse_file(File.expand_path('../exception_handler_spec.ru', __FILE__)).first}
|
34
34
|
|
35
35
|
it "should successfully call the controller method" do
|
36
|
-
get "/controller/blow"
|
36
|
+
get "/controller/blow?fatal=true"
|
37
37
|
|
38
38
|
expect(last_response.status).to be == 400
|
39
39
|
expect(last_response.body).to be_include 'Fatal Error'
|
40
40
|
end
|
41
|
+
|
42
|
+
it "should fail with a 500 error" do
|
43
|
+
get "/controller/blow"
|
44
|
+
|
45
|
+
expect(last_response.status).to be == 500
|
46
|
+
expect(last_response.body).to be_include 'Error Will Robertson'
|
47
|
+
end
|
41
48
|
end
|
42
49
|
end
|
@@ -34,6 +34,10 @@ on 'blow' do
|
|
34
34
|
raise TharSheBlows.new("Arrrh!")
|
35
35
|
end
|
36
36
|
|
37
|
-
on 'exception' do
|
38
|
-
|
37
|
+
on 'exception' do |request|
|
38
|
+
if request['fatal']
|
39
|
+
raise TharSheBlows.new("Yarrh!")
|
40
|
+
else
|
41
|
+
success! :content => 'Error Will Robertson', :type => 'text/plain'
|
42
|
+
end
|
39
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trenni
|