rewritten 0.11.0 → 0.11.1
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/url.rb +1 -1
- data/lib/rewritten/version.rb +1 -1
- data/test/rack/rewritten_url_test.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8ba08046a15f42633b2dec58e2e247ea7846bf4
|
4
|
+
data.tar.gz: bca98d1baffa155d808177bd5a39757af51d9d39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6afd910262c5cb94bc94dc01d2e378c18f4e9e22d1082257beacbafc9f00d8f48f3e380c3cc45b0274c28f5feb148b20e134846672fcc6fbdc8acdd0020eae76
|
7
|
+
data.tar.gz: d2fcdfb104a789539f788c7ca98300c3618d85d9b233429ca0137e3a0a7c4425dfaf5b6a6ef5f6282b6ffe30beb4e7d78ba87ced5da99f3b9b063e8d595b66b1
|
data/HISTORY.rdoc
CHANGED
data/lib/rack/url.rb
CHANGED
@@ -74,7 +74,7 @@ module Rack
|
|
74
74
|
if(path).count('/') > 1 && translate_partial?
|
75
75
|
parts = path.split('/')
|
76
76
|
req.path_info = parts.slice(0, parts.size-1).join('/')
|
77
|
-
self.call(req.env, parts.last + tail
|
77
|
+
self.call(req.env, parts.last + (tail ? "/" + tail : ""))
|
78
78
|
else
|
79
79
|
req.path_info = (tail ? req.path_info+"/"+tail : req.path_info)
|
80
80
|
@app.call(req.env)
|
data/lib/rewritten/version.rb
CHANGED
@@ -92,6 +92,21 @@ describe Rack::Rewritten::Url do
|
|
92
92
|
@env['PATH_INFO'].must_equal '/products/1/with_tail'
|
93
93
|
end
|
94
94
|
|
95
|
+
it "must work on long, non-translated urls with partial translation enabled" do
|
96
|
+
@rack = Rack::Rewritten::Url.new(@app) do
|
97
|
+
self.translate_partial = true
|
98
|
+
end
|
99
|
+
|
100
|
+
@app.expect :call, [200, {'Content-Type' => 'text/html'},[]], [Hash]
|
101
|
+
|
102
|
+
url = '/such/a/long/url/with/so/many/slashes/oh/my/god'
|
103
|
+
@env = request_url(url)
|
104
|
+
|
105
|
+
ret = @rack.call @env
|
106
|
+
@app.verify
|
107
|
+
@env['PATH_INFO'].must_equal url
|
108
|
+
end
|
109
|
+
|
95
110
|
it "must add the canonical tag to pages with trail" do
|
96
111
|
|
97
112
|
@rack = Rack::Rewritten::Url.new(lambda{|env| [200, {'Content-Type' => 'text/html'}, [@html_body]]}) do
|
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.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kai Rubarth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-namespace
|