http_router 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/http_router/version.rb +1 -1
- data/lib/http_router.rb +1 -1
- data/test/test_misc.rb +15 -0
- metadata +2 -55
data/lib/http_router/version.rb
CHANGED
data/lib/http_router.rb
CHANGED
@@ -205,7 +205,6 @@ class HttpRouter
|
|
205
205
|
env['PATH_INFO'] = ''
|
206
206
|
end
|
207
207
|
|
208
|
-
private
|
209
208
|
def no_response(env, perform_call = true)
|
210
209
|
supported_methods = @known_methods.select do |m|
|
211
210
|
next if m == env['REQUEST_METHOD']
|
@@ -218,6 +217,7 @@ class HttpRouter
|
|
218
217
|
supported_methods.empty? ? (perform_call ? @default_app.call(env) : nil) : [405, {'Allow' => supported_methods.sort.join(", ")}, []]
|
219
218
|
end
|
220
219
|
|
220
|
+
private
|
221
221
|
def add_with_request_method(path, method, opts = {}, &app)
|
222
222
|
route = add(path, opts).send(method.to_sym)
|
223
223
|
route.to(app) if app
|
data/test/test_misc.rb
CHANGED
@@ -57,4 +57,19 @@ class TestMisc < MiniTest::Unit::TestCase
|
|
57
57
|
assert_equal '/test/var', r.url(:route, :variable => "var")
|
58
58
|
assert_raises(HttpRouter::InvalidRouteException) { r.url(:route) }
|
59
59
|
end
|
60
|
+
|
61
|
+
def test_public_interface
|
62
|
+
methods = HttpRouter.public_instance_methods.map(&:to_sym)
|
63
|
+
assert methods.include?(:url_mount)
|
64
|
+
assert methods.include?(:url_mount=)
|
65
|
+
assert methods.include?(:call)
|
66
|
+
assert methods.include?(:recognize)
|
67
|
+
assert methods.include?(:url)
|
68
|
+
assert methods.include?(:pass_on_response)
|
69
|
+
assert methods.include?(:ignore_trailing_slash?)
|
70
|
+
assert methods.include?(:redirect_trailing_slash?)
|
71
|
+
assert methods.include?(:process_destination_path)
|
72
|
+
assert methods.include?(:rewrite_partial_path_info)
|
73
|
+
assert methods.include?(:rewrite_path_info)
|
74
|
+
end
|
60
75
|
end
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 51
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 9
|
9
|
-
- 4
|
10
|
-
version: 0.9.4
|
5
|
+
version: 0.9.5
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Joshua Hull
|
@@ -15,7 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-30 00:00:00 -07:00
|
19
14
|
default_executable:
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
@@ -26,11 +21,6 @@ dependencies:
|
|
26
21
|
requirements:
|
27
22
|
- - ">="
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 23
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 0
|
33
|
-
- 0
|
34
24
|
version: 1.0.0
|
35
25
|
type: :runtime
|
36
26
|
version_requirements: *id001
|
@@ -42,11 +32,6 @@ dependencies:
|
|
42
32
|
requirements:
|
43
33
|
- - ~>
|
44
34
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 21
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 2
|
49
|
-
- 1
|
50
35
|
version: 0.2.1
|
51
36
|
type: :runtime
|
52
37
|
version_requirements: *id002
|
@@ -58,11 +43,6 @@ dependencies:
|
|
58
43
|
requirements:
|
59
44
|
- - ~>
|
60
45
|
- !ruby/object:Gem::Version
|
61
|
-
hash: 15
|
62
|
-
segments:
|
63
|
-
- 2
|
64
|
-
- 0
|
65
|
-
- 0
|
66
46
|
version: 2.0.0
|
67
47
|
type: :development
|
68
48
|
version_requirements: *id003
|
@@ -74,9 +54,6 @@ dependencies:
|
|
74
54
|
requirements:
|
75
55
|
- - ">="
|
76
56
|
- !ruby/object:Gem::Version
|
77
|
-
hash: 3
|
78
|
-
segments:
|
79
|
-
- 0
|
80
57
|
version: "0"
|
81
58
|
type: :development
|
82
59
|
version_requirements: *id004
|
@@ -88,11 +65,6 @@ dependencies:
|
|
88
65
|
requirements:
|
89
66
|
- - ~>
|
90
67
|
- !ruby/object:Gem::Version
|
91
|
-
hash: 49
|
92
|
-
segments:
|
93
|
-
- 0
|
94
|
-
- 8
|
95
|
-
- 7
|
96
68
|
version: 0.8.7
|
97
69
|
type: :development
|
98
70
|
version_requirements: *id005
|
@@ -104,9 +76,6 @@ dependencies:
|
|
104
76
|
requirements:
|
105
77
|
- - ">="
|
106
78
|
- !ruby/object:Gem::Version
|
107
|
-
hash: 3
|
108
|
-
segments:
|
109
|
-
- 0
|
110
79
|
version: "0"
|
111
80
|
type: :development
|
112
81
|
version_requirements: *id006
|
@@ -118,9 +87,6 @@ dependencies:
|
|
118
87
|
requirements:
|
119
88
|
- - ">="
|
120
89
|
- !ruby/object:Gem::Version
|
121
|
-
hash: 3
|
122
|
-
segments:
|
123
|
-
- 0
|
124
90
|
version: "0"
|
125
91
|
type: :development
|
126
92
|
version_requirements: *id007
|
@@ -132,9 +98,6 @@ dependencies:
|
|
132
98
|
requirements:
|
133
99
|
- - ">="
|
134
100
|
- !ruby/object:Gem::Version
|
135
|
-
hash: 3
|
136
|
-
segments:
|
137
|
-
- 0
|
138
101
|
version: "0"
|
139
102
|
type: :development
|
140
103
|
version_requirements: *id008
|
@@ -146,11 +109,6 @@ dependencies:
|
|
146
109
|
requirements:
|
147
110
|
- - ~>
|
148
111
|
- !ruby/object:Gem::Version
|
149
|
-
hash: 23
|
150
|
-
segments:
|
151
|
-
- 1
|
152
|
-
- 0
|
153
|
-
- 0
|
154
112
|
version: 1.0.0
|
155
113
|
type: :development
|
156
114
|
version_requirements: *id009
|
@@ -162,11 +120,6 @@ dependencies:
|
|
162
120
|
requirements:
|
163
121
|
- - "="
|
164
122
|
- !ruby/object:Gem::Version
|
165
|
-
hash: 15
|
166
|
-
segments:
|
167
|
-
- 1
|
168
|
-
- 2
|
169
|
-
- 8
|
170
123
|
version: 1.2.8
|
171
124
|
type: :development
|
172
125
|
version_requirements: *id010
|
@@ -256,18 +209,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
256
209
|
requirements:
|
257
210
|
- - ">="
|
258
211
|
- !ruby/object:Gem::Version
|
259
|
-
hash: 3
|
260
|
-
segments:
|
261
|
-
- 0
|
262
212
|
version: "0"
|
263
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
214
|
none: false
|
265
215
|
requirements:
|
266
216
|
- - ">="
|
267
217
|
- !ruby/object:Gem::Version
|
268
|
-
hash: 3
|
269
|
-
segments:
|
270
|
-
- 0
|
271
218
|
version: "0"
|
272
219
|
requirements: []
|
273
220
|
|