http_router 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/http_router/node/path.rb +1 -1
- data/lib/http_router/node/root.rb +0 -10
- data/lib/http_router/version.rb +1 -1
- data/lib/http_router.rb +10 -0
- metadata +33 -33
@@ -38,7 +38,7 @@ class HttpRouter
|
|
38
38
|
env['router.request'] = request
|
39
39
|
env['router.params'] ||= {}
|
40
40
|
#{"env['router.params'].merge!(Hash[#{param_names.inspect}.zip(request.params)])" if dynamic?}
|
41
|
-
rewrite#{"_partial" if route.match_partially?}_path_info(env, request)
|
41
|
+
@router.rewrite#{"_partial" if route.match_partially?}_path_info(env, request)
|
42
42
|
response = @router.process_destination_path(#{path_ivar}, env)
|
43
43
|
router.pass_on_response(response) ? throw(:pass) : throw(:success, response)
|
44
44
|
else
|
@@ -29,16 +29,6 @@ class HttpRouter
|
|
29
29
|
end
|
30
30
|
|
31
31
|
private
|
32
|
-
def rewrite_partial_path_info(env, request)
|
33
|
-
env['PATH_INFO'] = "/#{request.path.join('/')}"
|
34
|
-
env['SCRIPT_NAME'] += request.rack_request.path_info[0, request.rack_request.path_info.size - env['PATH_INFO'].size]
|
35
|
-
end
|
36
|
-
|
37
|
-
def rewrite_path_info(env, request)
|
38
|
-
env['SCRIPT_NAME'] += request.rack_request.path_info
|
39
|
-
env['PATH_INFO'] = ''
|
40
|
-
end
|
41
|
-
|
42
32
|
def compile
|
43
33
|
root.extend(root.methods_module)
|
44
34
|
instance_eval "def [](request)\n#{to_code}\nnil\nend", __FILE__, __LINE__
|
data/lib/http_router/version.rb
CHANGED
data/lib/http_router.rb
CHANGED
@@ -195,6 +195,16 @@ class HttpRouter
|
|
195
195
|
cloned_router
|
196
196
|
end
|
197
197
|
|
198
|
+
def rewrite_partial_path_info(env, request)
|
199
|
+
env['PATH_INFO'] = "/#{request.path.join('/')}"
|
200
|
+
env['SCRIPT_NAME'] += request.rack_request.path_info[0, request.rack_request.path_info.size - env['PATH_INFO'].size]
|
201
|
+
end
|
202
|
+
|
203
|
+
def rewrite_path_info(env, request)
|
204
|
+
env['SCRIPT_NAME'] += request.rack_request.path_info
|
205
|
+
env['PATH_INFO'] = ''
|
206
|
+
end
|
207
|
+
|
198
208
|
private
|
199
209
|
def no_response(env, perform_call = true)
|
200
210
|
supported_methods = @known_methods.select do |m|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 4
|
10
|
+
version: 0.9.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Hull
|
@@ -19,8 +19,9 @@ date: 2011-07-27 00:00:00 -07:00
|
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
+
name: rack
|
22
23
|
prerelease: false
|
23
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
25
26
|
requirements:
|
26
27
|
- - ">="
|
@@ -31,12 +32,12 @@ dependencies:
|
|
31
32
|
- 0
|
32
33
|
- 0
|
33
34
|
version: 1.0.0
|
34
|
-
requirement: *id001
|
35
|
-
name: rack
|
36
35
|
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
|
+
name: url_mount
|
38
39
|
prerelease: false
|
39
|
-
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
42
|
requirements:
|
42
43
|
- - ~>
|
@@ -47,12 +48,12 @@ dependencies:
|
|
47
48
|
- 2
|
48
49
|
- 1
|
49
50
|
version: 0.2.1
|
50
|
-
requirement: *id002
|
51
|
-
name: url_mount
|
52
51
|
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
+
name: minitest
|
54
55
|
prerelease: false
|
55
|
-
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
57
|
none: false
|
57
58
|
requirements:
|
58
59
|
- - ~>
|
@@ -63,12 +64,12 @@ dependencies:
|
|
63
64
|
- 0
|
64
65
|
- 0
|
65
66
|
version: 2.0.0
|
66
|
-
requirement: *id003
|
67
|
-
name: minitest
|
68
67
|
type: :development
|
68
|
+
version_requirements: *id003
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
+
name: code_stats
|
70
71
|
prerelease: false
|
71
|
-
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
72
73
|
none: false
|
73
74
|
requirements:
|
74
75
|
- - ">="
|
@@ -77,12 +78,12 @@ dependencies:
|
|
77
78
|
segments:
|
78
79
|
- 0
|
79
80
|
version: "0"
|
80
|
-
requirement: *id004
|
81
|
-
name: code_stats
|
82
81
|
type: :development
|
82
|
+
version_requirements: *id004
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
84
85
|
prerelease: false
|
85
|
-
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
86
87
|
none: false
|
87
88
|
requirements:
|
88
89
|
- - ~>
|
@@ -93,12 +94,12 @@ dependencies:
|
|
93
94
|
- 8
|
94
95
|
- 7
|
95
96
|
version: 0.8.7
|
96
|
-
requirement: *id005
|
97
|
-
name: rake
|
98
97
|
type: :development
|
98
|
+
version_requirements: *id005
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
|
+
name: rbench
|
100
101
|
prerelease: false
|
101
|
-
|
102
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
102
103
|
none: false
|
103
104
|
requirements:
|
104
105
|
- - ">="
|
@@ -107,12 +108,12 @@ dependencies:
|
|
107
108
|
segments:
|
108
109
|
- 0
|
109
110
|
version: "0"
|
110
|
-
requirement: *id006
|
111
|
-
name: rbench
|
112
111
|
type: :development
|
112
|
+
version_requirements: *id006
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
|
+
name: json
|
114
115
|
prerelease: false
|
115
|
-
|
116
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
116
117
|
none: false
|
117
118
|
requirements:
|
118
119
|
- - ">="
|
@@ -121,12 +122,12 @@ dependencies:
|
|
121
122
|
segments:
|
122
123
|
- 0
|
123
124
|
version: "0"
|
124
|
-
requirement: *id007
|
125
|
-
name: json
|
126
125
|
type: :development
|
126
|
+
version_requirements: *id007
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
|
+
name: phocus
|
128
129
|
prerelease: false
|
129
|
-
|
130
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
130
131
|
none: false
|
131
132
|
requirements:
|
132
133
|
- - ">="
|
@@ -135,12 +136,12 @@ dependencies:
|
|
135
136
|
segments:
|
136
137
|
- 0
|
137
138
|
version: "0"
|
138
|
-
requirement: *id008
|
139
|
-
name: phocus
|
140
139
|
type: :development
|
140
|
+
version_requirements: *id008
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
|
+
name: bundler
|
142
143
|
prerelease: false
|
143
|
-
|
144
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
144
145
|
none: false
|
145
146
|
requirements:
|
146
147
|
- - ~>
|
@@ -151,12 +152,12 @@ dependencies:
|
|
151
152
|
- 0
|
152
153
|
- 0
|
153
154
|
version: 1.0.0
|
154
|
-
requirement: *id009
|
155
|
-
name: bundler
|
156
155
|
type: :development
|
156
|
+
version_requirements: *id009
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
|
+
name: thin
|
158
159
|
prerelease: false
|
159
|
-
|
160
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
160
161
|
none: false
|
161
162
|
requirements:
|
162
163
|
- - "="
|
@@ -167,9 +168,8 @@ dependencies:
|
|
167
168
|
- 2
|
168
169
|
- 8
|
169
170
|
version: 1.2.8
|
170
|
-
requirement: *id010
|
171
|
-
name: thin
|
172
171
|
type: :development
|
172
|
+
version_requirements: *id010
|
173
173
|
description: This library allows you to recognize and build URLs in a Rack application.
|
174
174
|
email: joshbuddy@gmail.com
|
175
175
|
executables: []
|