scorched 0.26 → 0.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +2 -0
- data/lib/scorched/controller.rb +7 -2
- data/lib/scorched/version.rb +1 -1
- data/spec/controller_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 492839ee866fd2c9d5eaf33de738c1661008ed93
|
4
|
+
data.tar.gz: 2ce3ad605482f1d5a96973cddb4fa4ab910d4db7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cecfe761d1070e78f7b112dd158aed15768dbe3be19e9953c24c578b36b26487f3f4905632a4346326fe9d3eaa0a948dd7e9724c0aec6643b2bd2f80a02861e
|
7
|
+
data.tar.gz: 9f21239c86254de3d08c1c03672a053d7a6163b4afafe2c6aa662801702dd36a77b5ed4e93934fce5f74c8d7bf212e84f6cf6757767b7636b5f6f0f374eca374
|
data/CHANGES.md
CHANGED
@@ -3,6 +3,8 @@ Changelog
|
|
3
3
|
|
4
4
|
_Note that Scorched is yet to reach a v1.0 release. This means breaking changes may still be made. If upgrading the version of Scorched for your project, review this changelog carefully._
|
5
5
|
|
6
|
+
### v0.27
|
7
|
+
* Fixed logic surrounding when a requested is considered "handled" (i.e. matched and dispatched) and exceptions that are raised after dispatch. In simpler terms, the `failed_condition` condition now has better logic in the event of an exception.
|
6
8
|
### v0.26
|
7
9
|
* Fixed issue with `failed_condition` condition resulting in `NoMethodError: undefined method '[]' for nil:NilClass`
|
8
10
|
### v0.25
|
data/lib/scorched/controller.rb
CHANGED
@@ -306,8 +306,13 @@ module Scorched
|
|
306
306
|
}.reverse.each { |match,idx|
|
307
307
|
request.breadcrumb << match
|
308
308
|
catch(:pass) {
|
309
|
-
|
310
|
-
|
309
|
+
begin
|
310
|
+
catch(:halt) do
|
311
|
+
dispatch(match)
|
312
|
+
end
|
313
|
+
rescue
|
314
|
+
@_handled = true
|
315
|
+
raise
|
311
316
|
end
|
312
317
|
@_handled = true
|
313
318
|
}
|
data/lib/scorched/version.rb
CHANGED
data/spec/controller_spec.rb
CHANGED
@@ -788,6 +788,13 @@ module Scorched
|
|
788
788
|
rt.get('/nopass').status.should == 200
|
789
789
|
handled.should be_truthy
|
790
790
|
end
|
791
|
+
|
792
|
+
it "is still considered a match if an exception is raised" do
|
793
|
+
app.post('/') { }
|
794
|
+
app.get('/') { raise "Test error"}
|
795
|
+
app.error { true } # Returns true to supress the exception
|
796
|
+
rt.get('/').status.should == 200 # Would return a 405 or something other than a 200 prior to v0.27.
|
797
|
+
end
|
791
798
|
end
|
792
799
|
|
793
800
|
describe "status codes" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scorched
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.27'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Wardrop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|