rewritten 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b8a500718f5764e1215c94dcefc425cfa4fb609
4
- data.tar.gz: c36cd32276590c3ccda6b0ff56371dcd09e37f43
3
+ metadata.gz: a8ba08046a15f42633b2dec58e2e247ea7846bf4
4
+ data.tar.gz: bca98d1baffa155d808177bd5a39757af51d9d39
5
5
  SHA512:
6
- metadata.gz: 4597038ac4306fbc18f19474c744de3fa1077c817b85e5d98c360bac7900e9f5340d8a83c8243f1f25afe1c3d2fa7297c8b654e5d5210b5f196c7ed2ac50bdb4
7
- data.tar.gz: be0923ab8fd3e7567ef325257ecfa1be9a4b0942e45665985d7aa15992a9c3928f591af3ff7c4d599dfb20cd70c1fee3d18193695b63dd4957b1deb0bb8852a3
6
+ metadata.gz: 6afd910262c5cb94bc94dc01d2e378c18f4e9e22d1082257beacbafc9f00d8f48f3e380c3cc45b0274c28f5feb148b20e134846672fcc6fbdc8acdd0020eae76
7
+ data.tar.gz: d2fcdfb104a789539f788c7ca98300c3618d85d9b233429ca0137e3a0a7c4425dfaf5b6a6ef5f6282b6ffe30beb4e7d78ba87ced5da99f3b9b063e8d595b66b1
data/HISTORY.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.11.1
2
+
3
+ * Fixes bug with non-translated urls longer than one segment
4
+
1
5
  == 0.11.0
2
6
 
3
7
  * Partial translations and canonical tags in Rack::Rewritten::Url
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.to_s)
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)
@@ -1,4 +1,4 @@
1
1
  module Rewritten
2
- VERSION = "0.11.0"
2
+ VERSION = "0.11.1"
3
3
  end
4
4
 
@@ -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.0
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-18 00:00:00.000000000 Z
11
+ date: 2013-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-namespace