rewritten 0.16.1 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.rdoc +4 -0
- data/lib/rack/dummy.rb +1 -1
- data/lib/rack/url.rb +1 -1
- data/lib/rewritten.rb +1 -1
- data/lib/rewritten/server.rb +1 -1
- data/lib/rewritten/version.rb +1 -1
- data/test/rack/rewritten_url_test.rb +7 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f112eb7501e764ea51292d0185de5fe06421351
|
4
|
+
data.tar.gz: 5f0fc796727a729abae3031a69b054f3af1c7b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fbda39b0eec4d9373a9738565b78f4f4891b1a27a40dc077c6265a4cf8cf90f65103849a43a852d68cb7b0f6705768e945ffff097384ba869eb8e960782b45d
|
7
|
+
data.tar.gz: e4c199b7a68673f1119e06d3eaf90e315227cbe1eeb716f4d272bdba2128012da910e52efd9c7c2df0f9e2dd48a6690e5321feef48098183b4f668f218a9fcb9
|
data/HISTORY.rdoc
CHANGED
data/lib/rack/dummy.rb
CHANGED
@@ -12,7 +12,7 @@ module Rack
|
|
12
12
|
lines << req.env.inspect
|
13
13
|
lines << "SUBDOMAIN: #{env['SUBDOMAIN']}"
|
14
14
|
lines << '<a href="/some/resource">'
|
15
|
-
[200, { 'Content-Type'
|
15
|
+
[200, { 'Content-Type' => 'text/plain' }, lines.join("\n")]
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/rack/url.rb
CHANGED
@@ -51,7 +51,7 @@ module Rack
|
|
51
51
|
# if this is the current path, rewrite path and parameters
|
52
52
|
tpath, tparams = split_to_path_params(to)
|
53
53
|
env['QUERY_STRING'] = Rack::Utils.build_nested_query(tparams.merge(req.params))
|
54
|
-
req.path_info = tpath + ::Rewritten.appendix(req.
|
54
|
+
req.path_info = tpath + ::Rewritten.appendix(req.fullpath)
|
55
55
|
@app.call(req.env)
|
56
56
|
else
|
57
57
|
# if this is not the current path, redirect to current path
|
data/lib/rewritten.rb
CHANGED
data/lib/rewritten/server.rb
CHANGED
data/lib/rewritten/version.rb
CHANGED
@@ -193,7 +193,6 @@ describe Rack::Rewritten::Url do
|
|
193
193
|
@app.verify
|
194
194
|
ret[0].must_equal 200
|
195
195
|
end
|
196
|
-
|
197
196
|
end
|
198
197
|
|
199
198
|
describe 'flag behavior' do
|
@@ -259,5 +258,12 @@ describe Rack::Rewritten::Url do
|
|
259
258
|
@rack.call(@initial_args)
|
260
259
|
@initial_args['PATH_INFO'].must_equal '/embed/2'
|
261
260
|
end
|
261
|
+
|
262
|
+
it 'must translate if the only translation is a parameter translation' do
|
263
|
+
Rewritten.add_translation '/foo/two/params?w=1', '/embed/2'
|
264
|
+
@initial_args.merge!('QUERY_STRING' => 'w=1', 'REQUEST_URI' => '/foo/two/params', 'PATH_INFO' => '/foo/two/params')
|
265
|
+
@rack.call(@initial_args)
|
266
|
+
@initial_args['PATH_INFO'].must_equal '/embed/2'
|
267
|
+
end
|
262
268
|
end
|
263
269
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rewritten
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kai Rubarth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-namespace
|
@@ -251,3 +251,4 @@ test_files:
|
|
251
251
|
- test/rewritten/document_test.rb
|
252
252
|
- test/rewritten_test.rb
|
253
253
|
- test/test_helper.rb
|
254
|
+
has_rdoc:
|