utopia 1.0.7 → 1.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c395039ab70656d75a27a42829fc0c9971411b6
4
- data.tar.gz: 354b43a1c34c1257ad2ed690ec28ef3549128982
3
+ metadata.gz: 54d9c31ecb199e89107637d08ff6b4d9f1cee359
4
+ data.tar.gz: 6a0e26e2670269546150f852e2ed40b39bf74f25
5
5
  SHA512:
6
- metadata.gz: 519aae56385dd417d0491cb4061acc6050a04857771c3137b3508dcb61e6dc3423c3ad04d06052ab43ad99d3aeb249a6f5b7240b69301d20735c962624af8af8
7
- data.tar.gz: be3d53f57bd9556b6ff55bf839ffb8af00bee0adeaabd730c20cd530366bb1c8db82cc127a734a381e020eff636f56d40dd7b1d99bb824d6695f525fdcd88df6
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
- return @app.call(env.merge('PATH_INFO' => @location, 'REQUEST_METHOD' => 'GET'))
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)
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "1.0.7"
22
+ VERSION = "1.0.8"
23
23
  end
@@ -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
- raise TharSheBlows.new("Yarrh!")
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.7
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-08 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trenni