rewritten 0.16.2 → 0.16.3
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/rewritten/version.rb +1 -1
- data/lib/rewritten.rb +2 -1
- data/test/rack/rewritten_url_test.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4c5d5f3b82a279cbf7537015998ea7bb2d953d1
|
4
|
+
data.tar.gz: c9d424c04a59af197e4809be37512e9b8099dc76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef7b3bb9e140229bc5d7bebe36624f80d9b65a98eb100b9044120f16989a0571af71478610263a29da7d04ccdf1a4659a5b4bd7f7ebec33ee6ef5a9ea81971df
|
7
|
+
data.tar.gz: de967382e05689032659860628760ff75debcd1d9fbee7bc9da42b6c95119ff0681c8d09c97a31fe7b0c58edbd8d083718a3c508a107b1d93114c8b58c384882
|
data/HISTORY.rdoc
CHANGED
data/lib/rewritten/version.rb
CHANGED
data/lib/rewritten.rb
CHANGED
@@ -247,7 +247,8 @@ module Rewritten
|
|
247
247
|
def appendix(some_from)
|
248
248
|
base = base_from(some_from) || ''
|
249
249
|
result = some_from.partition(base).last
|
250
|
-
result
|
250
|
+
return '' if result == ''
|
251
|
+
result.split('?').first.chomp('/')
|
251
252
|
end
|
252
253
|
|
253
254
|
def get_flag_string(from)
|
@@ -265,5 +265,13 @@ describe Rack::Rewritten::Url do
|
|
265
265
|
@rack.call(@initial_args)
|
266
266
|
@initial_args['PATH_INFO'].must_equal '/embed/2'
|
267
267
|
end
|
268
|
+
|
269
|
+
it 'must be possible to pass extra parameters not in translation' do
|
270
|
+
Rewritten.add_translation '/foo/without/params', '/embed/2'
|
271
|
+
@initial_args.merge!('QUERY_STRING' => 'w=1', 'REQUEST_URI' => '/foo/without/params', 'PATH_INFO' => '/foo/without/params')
|
272
|
+
@rack.call(@initial_args)
|
273
|
+
@initial_args['PATH_INFO'].must_equal '/embed/2'
|
274
|
+
@initial_args['QUERY_STRING'].must_equal 'w=1'
|
275
|
+
end
|
268
276
|
end
|
269
277
|
end
|