prerender_rails 1.6.2 → 1.7.0

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
  SHA256:
3
- metadata.gz: 9ad51a96d32341a8c7e1a16bab77e25d12496ba62f4106d50b4eedaec7463459
4
- data.tar.gz: 15a604ab01e06b512ca7a8f8d1bd2454eca2e74f618efb8bca2aa50bb1c062c8
3
+ metadata.gz: 0b7bb52e4361db6e0c211ae8b2bc21abc3181e7004bc46d06f7f7363e7a2a797
4
+ data.tar.gz: 7fe960c2ced57ff8ea9a3810e3c8cea844fde97b65b4e5dda030deeecf758566
5
5
  SHA512:
6
- metadata.gz: 5724c737f2d5ca3577cc68c3a4a614c7cc3a133c4cbb427f9cc987d0cdc62ecf49c867d9373a45e1cb06c3055ed26c58ccca6cf7433833946d92eda839a28d65
7
- data.tar.gz: fb6fa687514f28dba267cacf50422fa0e4ef82ab6e769ffd288b2b8ef966c33aea489078ffb490d1554bbd1800f2b76f9634f84c7e88ca491cae1bd0bc3a5141
6
+ metadata.gz: 1409773b53acd77e880007547a0dc5e5fbf07e2ccc06fde0f6ff0fc688d220c131e55d991e1f1810e7ca73990f3f5f844c49f110902406f0d43ae9d16189dc6b
7
+ data.tar.gz: 620548190f5384997a293b8a81f2cdc013b73a90adce2efcb4cee1a4a87e311c2451789260925cce841914067dc71ee15bc1304186e846405eb1383798fe88c1
@@ -213,7 +213,7 @@ module Rack
213
213
 
214
214
 
215
215
  def build_rack_response_from_prerender(prerendered_response)
216
- response = Rack::Response.new(prerendered_response.body, prerendered_response.code, prerendered_response.header)
216
+ response = Rack::Response.new(prerendered_response.body, prerendered_response.code, prerendered_response)
217
217
 
218
218
  @options[:build_rack_response_from_prerender].call(response, prerendered_response) if @options[:build_rack_response_from_prerender]
219
219
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "prerender_rails"
5
- spec.version = "1.6.2 "
5
+ spec.version = "1.7.0"
6
6
  spec.authors = ["Todd Hooper"]
7
7
  spec.email = ["todd@prerender.io"]
8
8
  spec.description = %q{Rails middleware to prerender your javascript heavy pages on the fly by a phantomjs service}
@@ -15,10 +15,10 @@ Gem::Specification.new do |spec|
15
15
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
16
  spec.require_paths = ["lib"]
17
17
 
18
- spec.add_dependency 'rack', '~> 2.0.6'
18
+ spec.add_dependency 'rack', '~> 2.2.2'
19
19
  spec.add_dependency 'activesupport', '>= 0'
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
21
+ spec.add_development_dependency "bundler", "~> 2.1.2"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "webmock"
24
24
  end
@@ -19,9 +19,9 @@ describe Rack::Prerender do
19
19
  stub_request(:get, @prerender.build_api_url(request)).with(:headers => { 'User-Agent' => bot }).to_return(:body => "<html></html>", :status => 301, :headers => { 'Location' => 'http://google.com'})
20
20
  response = Rack::Prerender.new(@app).call(request)
21
21
 
22
- assert_equal response[2].body, ["<html></html>"]
23
- assert_equal response[2].status, 301
24
- assert_equal( { 'location' => 'http://google.com', 'Content-Length' => '13'}, response[2].headers )
22
+ assert_equal response[2], ["<html></html>"]
23
+ assert_equal response[0], 301
24
+ assert_equal( { 'location' => 'http://google.com'}, response[1] )
25
25
  end
26
26
 
27
27
 
@@ -30,7 +30,7 @@ describe Rack::Prerender do
30
30
  stub_request(:get, @prerender.build_api_url(request)).with(:headers => { 'User-Agent' => user }).to_return(:body => "<html></html>")
31
31
  response = Rack::Prerender.new(@app).call(request)
32
32
 
33
- assert_equal ["<html></html>"], response[2].body
33
+ assert_equal ["<html></html>"], response[2]
34
34
  end
35
35
 
36
36
 
@@ -89,7 +89,7 @@ describe Rack::Prerender do
89
89
  stub_request(:get, @prerender.build_api_url(request)).to_return(:body => "<html></html>")
90
90
  response = @prerender.call(request)
91
91
 
92
- assert_equal ["<html></html>"], response[2].body
92
+ assert_equal ["<html></html>"], response[2]
93
93
  end
94
94
 
95
95
 
@@ -98,7 +98,7 @@ describe Rack::Prerender do
98
98
  stub_request(:get, @prerender.build_api_url(request)).to_return(:body => "<html></html>")
99
99
  response = Rack::Prerender.new(@app, whitelist: ['^/search.*page', '/help']).call(request)
100
100
 
101
- assert_equal ["<html></html>"], response[2].body
101
+ assert_equal ["<html></html>"], response[2]
102
102
  end
103
103
 
104
104
 
@@ -121,7 +121,7 @@ describe Rack::Prerender do
121
121
  stub_request(:get, @prerender.build_api_url(request)).to_return(:body => "<html></html>")
122
122
  response = Rack::Prerender.new(@app, blacklist: ['^/search', '/help']).call(request)
123
123
 
124
- assert_equal ["<html></html>"], response[2].body
124
+ assert_equal ["<html></html>"], response[2]
125
125
  end
126
126
 
127
127
 
@@ -138,7 +138,7 @@ describe Rack::Prerender do
138
138
  stub_request(:get, @prerender.build_api_url(request)).to_return(:body => "<html></html>")
139
139
  response = Rack::Prerender.new(@app, blacklist: ['^/search', '/help']).call(request)
140
140
 
141
- assert_equal ["<html></html>"], response[2].body
141
+ assert_equal ["<html></html>"], response[2]
142
142
  end
143
143
 
144
144
 
@@ -146,7 +146,7 @@ describe Rack::Prerender do
146
146
  request = Rack::MockRequest.env_for "/", "HTTP_USER_AGENT" => bot
147
147
  response = Rack::Prerender.new(@app, before_render: Proc.new do |env| '<html>cached</html>' end).call(request)
148
148
 
149
- assert_equal ["<html>cached</html>"], response[2].body
149
+ assert_equal ["<html>cached</html>"], response[2]
150
150
  end
151
151
 
152
152
 
@@ -154,9 +154,9 @@ describe Rack::Prerender do
154
154
  request = Rack::MockRequest.env_for "/", "HTTP_USER_AGENT" => bot
155
155
  response = Rack::Prerender.new(@app, before_render: Proc.new do |env| Rack::Response.new('<html>cached2</html>', 200, { 'test' => 'test2Header'}) end).call(request)
156
156
 
157
- assert_equal ["<html>cached2</html>"], response[2].body
158
- assert_equal response[2].status, 200
159
- assert_equal( { 'test' => 'test2Header', "Content-Length"=>"20"}, response[2].headers )
157
+ assert_equal ["<html>cached2</html>"], response[2]
158
+ assert_equal response[0], 200
159
+ assert_equal( { 'test' => 'test2Header'}, response[1] )
160
160
  end
161
161
 
162
162
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prerender_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Hooper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-04 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.6
19
+ version: 2.2.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.6
26
+ version: 2.2.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: 2.1.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: 2.1.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -117,8 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  requirements: []
120
- rubyforge_project:
121
- rubygems_version: 2.7.6
120
+ rubygems_version: 3.1.2
122
121
  signing_key:
123
122
  specification_version: 4
124
123
  summary: Prerender your backbone/angular/javascript rendered application on the fly