rack-routes 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -1
- data/lib/rack/routes.rb +2 -2
- data/test/test_rack_routes.rb +5 -5
- metadata +14 -9
data/Rakefile
CHANGED
@@ -13,7 +13,9 @@ require 'hoe'
|
|
13
13
|
Hoe.spec 'rack-routes' do
|
14
14
|
developer 'Brian Henderson', 'bhenderson@attinteractive.com'
|
15
15
|
|
16
|
-
|
16
|
+
self.readme_file = "README.rdoc"
|
17
|
+
|
18
|
+
self.testlib = :minitest
|
17
19
|
end
|
18
20
|
|
19
21
|
# vim: syntax=ruby
|
data/lib/rack/routes.rb
CHANGED
@@ -2,7 +2,7 @@ require 'uri'
|
|
2
2
|
|
3
3
|
module Rack
|
4
4
|
class Routes
|
5
|
-
VERSION = '0.1.
|
5
|
+
VERSION = '0.1.1'
|
6
6
|
|
7
7
|
class LocDirectiveError < RuntimeError; end
|
8
8
|
|
@@ -129,7 +129,7 @@ module Rack
|
|
129
129
|
|
130
130
|
def call! env
|
131
131
|
@env = env
|
132
|
-
@path = URI.
|
132
|
+
@path = URI.decode_www_form_component @env['PATH_INFO']
|
133
133
|
|
134
134
|
(matching_app || @app).call(env)
|
135
135
|
end
|
data/test/test_rack_routes.rb
CHANGED
@@ -46,7 +46,7 @@ class TestRack::TestRoutes < RoutesTestCase
|
|
46
46
|
app.location '/images/', :prefix => '^~' do
|
47
47
|
"3"
|
48
48
|
end
|
49
|
-
app.location /\.(gif|jpg|jpeg)$/i do
|
49
|
+
app.location %r/\.(gif|jpg|jpeg)$/i do
|
50
50
|
"4"
|
51
51
|
end
|
52
52
|
|
@@ -65,7 +65,7 @@ class TestRack::TestRoutes < RoutesTestCase
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_captures
|
68
|
-
app.location /^\/imag(.*)/ do
|
68
|
+
app.location %r/^\/imag(.*)/ do
|
69
69
|
end
|
70
70
|
|
71
71
|
@env['PATH_INFO'] = '/images/foo'
|
@@ -92,7 +92,7 @@ class TestRack::TestRoutes < RoutesTestCase
|
|
92
92
|
'1'
|
93
93
|
end
|
94
94
|
|
95
|
-
app.location /\/asdf/ do
|
95
|
+
app.location %r/\/asdf/ do
|
96
96
|
'2'
|
97
97
|
end
|
98
98
|
|
@@ -106,7 +106,7 @@ class TestRack::TestRoutes < RoutesTestCase
|
|
106
106
|
|
107
107
|
assert_location_match '1', '/asdf'
|
108
108
|
|
109
|
-
app.location /\/asdf/ do
|
109
|
+
app.location %r/\/asdf/ do
|
110
110
|
'2'
|
111
111
|
end
|
112
112
|
|
@@ -114,7 +114,7 @@ class TestRack::TestRoutes < RoutesTestCase
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def test_call_twice
|
117
|
-
app.location /\/asdf/ do
|
117
|
+
app.location %r/\/asdf/ do
|
118
118
|
'2'
|
119
119
|
end
|
120
120
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdoc
|
16
|
-
requirement: &
|
16
|
+
requirement: &10643260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.10'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10643260
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hoe
|
27
|
-
requirement: &
|
27
|
+
requirement: &10642840 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,8 +32,13 @@ dependencies:
|
|
32
32
|
version: '2.13'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
description: '
|
35
|
+
version_requirements: *10642840
|
36
|
+
description: ! 'Provides a routing layer for Rack similar to nginx location directive.
|
37
|
+
|
38
|
+
http://wiki.nginx.org/HttpCoreModule#location
|
39
|
+
|
40
|
+
|
41
|
+
support provided by ATT Interactive (http://yp.com)'
|
37
42
|
email:
|
38
43
|
- bhenderson@attinteractive.com
|
39
44
|
executables: []
|
@@ -52,12 +57,12 @@ files:
|
|
52
57
|
- test/helper.rb
|
53
58
|
- test/test_rack_routes.rb
|
54
59
|
- .gemtest
|
55
|
-
homepage:
|
60
|
+
homepage: https://github.com/bhenderson/rack-routes
|
56
61
|
licenses: []
|
57
62
|
post_install_message:
|
58
63
|
rdoc_options:
|
59
64
|
- --main
|
60
|
-
- README.
|
65
|
+
- README.rdoc
|
61
66
|
require_paths:
|
62
67
|
- lib
|
63
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -77,6 +82,6 @@ rubyforge_project: rack-routes
|
|
77
82
|
rubygems_version: 1.8.11
|
78
83
|
signing_key:
|
79
84
|
specification_version: 3
|
80
|
-
summary:
|
85
|
+
summary: Provides a routing layer for Rack similar to nginx location directive
|
81
86
|
test_files:
|
82
87
|
- test/test_rack_routes.rb
|