joshbuddy-usher 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/usher/node.rb +1 -1
- data/spec/private/recognize_spec.rb +6 -0
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/usher/node.rb
CHANGED
@@ -98,7 +98,7 @@ class Usher
|
|
98
98
|
end
|
99
99
|
elsif path.size.zero? && terminates?
|
100
100
|
Response.new(terminates, params)
|
101
|
-
elsif next_part = lookup[part = path.shift] || lookup[nil]
|
101
|
+
elsif !path.size.zero? && (next_part = lookup[part = path.shift] || lookup[nil])
|
102
102
|
case next_part.value
|
103
103
|
when Route::Variable
|
104
104
|
case next_part.value.type
|
@@ -52,6 +52,12 @@ describe "Usher route recognition" do
|
|
52
52
|
route_set.recognize(build_request({:method => 'get', :path => '/test/part/three'})).should == nil
|
53
53
|
end
|
54
54
|
|
55
|
+
it "shouldn't accept a nil variable" do
|
56
|
+
target_route = route_set.add_route('/:one')
|
57
|
+
route_set.recognize(build_request({:method => 'get', :path => '/one'})).path.route.should == target_route
|
58
|
+
route_set.recognize(build_request({:method => 'get', :path => '/'})).should == nil
|
59
|
+
end
|
60
|
+
|
55
61
|
it "should recgonize a regex static part containing {}'s" do
|
56
62
|
target_route = route_set.add_route('/test/part/{^o{2,3}$}')
|
57
63
|
route_set.recognize(build_request({:method => 'get', :path => '/test/part/oo'})).path.route.should == target_route
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: joshbuddy-usher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Hull
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|