rewritten 0.8.1 → 0.8.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: 176780637c69e65f8bfdddb6da0611fbf870cd18
4
- data.tar.gz: 523eddc494f2a72228ccf4486e5b137861fbc051
3
+ metadata.gz: 209d70c9a3b200f7541f26509e60f3606869fd94
4
+ data.tar.gz: a1bb41ce3c1da38d98912211b9e894f50f987d95
5
5
  SHA512:
6
- metadata.gz: b3de980c77f3a47bf75293fbe7c24e000d530321db0465b392a6b37c44c04c326a6765af8981bc48461f0f893b6fdbf0c29b068bbd80b1108f34739a6a504076
7
- data.tar.gz: 83649e1157f994f1d1bceaf763bfc89ddab740de1e6c1268d708ec95ba3fdbcbd0ff7d8063327b5e5b42c5e5a8cdae9974f5486726fc5b06609dce7295400e97
6
+ metadata.gz: ca36c2bd7e90bb093adabd289195c197477ef3a89feb6782e46f559054889ee2cd06f08f96dd8849e54bd68c078eff307e23f4e504c2c949d52c341e2954dc14
7
+ data.tar.gz: cd854f0f45cf703d7310881c9cf9bf1a91bddd1d628df6ab62a95ff899462984fd88458dc1fa3bfc9815215cab2290c8b74a7c34628910aee15db7a35e12c671
@@ -1,4 +1,4 @@
1
1
  module Rewritten
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
4
4
 
data/lib/rewritten.rb CHANGED
@@ -6,7 +6,6 @@ require 'rack/url'
6
6
  require 'rack/record'
7
7
  require 'rack/html'
8
8
  require 'rack/subdomain'
9
- require 'pry'
10
9
 
11
10
  module Rewritten
12
11
  include Helpers
@@ -12,8 +12,8 @@ describe Rack::Rewritten::Url do
12
12
  'rack.url_scheme' => 'http'}.merge(overrides)
13
13
  end
14
14
 
15
- def request_url(url)
16
- call_args.merge('REQUEST_URI' => url, 'PATH_INFO' => url )
15
+ def request_url(url, params={})
16
+ call_args.merge({'REQUEST_URI' => url, 'PATH_INFO' => url}.merge(params) )
17
17
  end
18
18
 
19
19
  before {
@@ -40,14 +40,14 @@ describe Rack::Rewritten::Url do
40
40
  end
41
41
 
42
42
  it "must 301 redirect from old translation to latest translation" do
43
- ret = @rack.call( call_args.merge('REQUEST_URI' => '/foo/bar', 'PATH_INFO' => '/foo/bar' ))
43
+ ret = @rack.call request_url('/foo/bar')
44
44
  @app.verify
45
45
  ret[0].must_equal 301
46
46
  ret[1]['Location'].must_equal "http://www.example.org/foo/baz"
47
47
  end
48
48
 
49
49
  it "must keep the query parameters in the 301 redirect" do
50
- ret = @rack.call( call_args.merge('REQUEST_URI' => '/foo/bar', 'PATH_INFO' => '/foo/bar', 'QUERY_STRING' => 'w=1' ))
50
+ ret = @rack.call request_url('/foo/bar', 'QUERY_STRING' => 'w=1')
51
51
  @app.verify
52
52
  ret[0].must_equal 301
53
53
  ret[1]['Location'].must_equal "http://www.example.org/foo/baz?w=1"
@@ -55,7 +55,7 @@ describe Rack::Rewritten::Url do
55
55
 
56
56
  it "must stay on latest translation" do
57
57
  @app.expect :call, [200, {'Content-Type' => 'text/plain'},[""]], [Hash]
58
- ret = @rack.call( call_args.merge('REQUEST_URI' => '/foo/baz', 'PATH_INFO' => '/foo/baz' ))
58
+ ret = @rack.call request_url('/foo/baz')
59
59
  @app.verify
60
60
  ret[0].must_equal 200
61
61
  end
@@ -64,7 +64,7 @@ describe Rack::Rewritten::Url do
64
64
 
65
65
  it "must not redirect from resource url to nice url by default" do
66
66
  @app.expect :call, [200, {'Content-Type' => 'text/plain'},[""]], [Hash]
67
- ret = @rack.call( call_args.merge('REQUEST_URI' => '/products/1', 'PATH_INFO' => '/products/1' ))
67
+ ret = @rack.call request_url('/products/1')
68
68
  @app.verify
69
69
  ret[0].must_equal 200
70
70
  end
@@ -74,7 +74,7 @@ describe Rack::Rewritten::Url do
74
74
  self.translate_backwards = true
75
75
  end
76
76
 
77
- ret = @rack.call( call_args.merge('REQUEST_URI' => '/products/1', 'PATH_INFO' => '/products/1' ))
77
+ ret = @rack.call request_url('/products/1')
78
78
  @app.verify
79
79
  ret[0].must_equal 301
80
80
  ret[1]['Location'].must_equal "http://www.example.org/foo/baz"
@@ -105,7 +105,7 @@ describe Rack::Rewritten::Url do
105
105
  end
106
106
 
107
107
  it "must redirect for other entries" do
108
- ret = @rack.call( request_url('/no/flags') )
108
+ ret = @rack.call request_url('/no/flags')
109
109
  @app.verify
110
110
  ret[0].must_equal 301
111
111
  ret[1]['Location'].must_equal "http://www.example.org/final/line"
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.8.1
4
+ version: 0.8.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: 2013-05-13 00:00:00.000000000 Z
11
+ date: 2013-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-namespace