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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc8f7c951c788595d33a51ef61a2c0816bce4434
4
- data.tar.gz: 6c9b8f754364a3085b625de88771d773e858de76
3
+ metadata.gz: 9f112eb7501e764ea51292d0185de5fe06421351
4
+ data.tar.gz: 5f0fc796727a729abae3031a69b054f3af1c7b2f
5
5
  SHA512:
6
- metadata.gz: e16d7961db76c0ba4e6f39d6304339fe3acce5e3ef430a2a0f01b2c60099da0f820ea1a55be72d6c816074e618ba77a3901de1fb4d9b2d44357b55ee45a95463
7
- data.tar.gz: 89162c04f68b099dda7b8d5499160e06dc693029fff79d7e48d71f387ea97dd09e817c72fb4553aa9ec0ac873cdc6a080b523460c3c044a054da1265e5a20e9c
6
+ metadata.gz: 2fbda39b0eec4d9373a9738565b78f4f4891b1a27a40dc077c6265a4cf8cf90f65103849a43a852d68cb7b0f6705768e945ffff097384ba869eb8e960782b45d
7
+ data.tar.gz: e4c199b7a68673f1119e06d3eaf90e315227cbe1eeb716f4d272bdba2128012da910e52efd9c7c2df0f9e2dd48a6690e5321feef48098183b4f668f218a9fcb9
data/HISTORY.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.16.2
2
+
3
+ * Fix bug with query parameter translations without naked path_info translations
4
+
1
5
  == 0.16.1
2
6
 
3
7
  * include exception list for reverse translations
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' => 'text/plain' }, lines.join("\n")]
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.path_info)
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
@@ -140,7 +140,7 @@ module Rewritten
140
140
  end
141
141
 
142
142
  def add_translations(to, froms)
143
- froms.each { |from| add_translation(from, to) }
143
+ froms.each { |from| add_translation(from, to) }
144
144
  end
145
145
 
146
146
  def num_translations(to)
@@ -8,7 +8,7 @@ module Rewritten
8
8
  class Server < Sinatra::Base
9
9
  dir = File.dirname(File.expand_path(__FILE__))
10
10
 
11
- set :views, "#{dir}/server/views"
11
+ set :views, "#{dir}/server/views"
12
12
  set :public_folder, "#{dir}/server/public"
13
13
  set :static, true
14
14
 
@@ -1,3 +1,3 @@
1
1
  module Rewritten
2
- VERSION = '0.16.1'
2
+ VERSION = '0.16.2'
3
3
  end
@@ -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.1
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: 2015-12-14 00:00:00.000000000 Z
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: