prerender_rails 0.1.2 → 0.1.3

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: fffaf338614d81a13df75539ed9de2fc2f63fcea
4
- data.tar.gz: 94b5487d1000a7caaec217c920a5ec0c9a56a5d3
3
+ metadata.gz: 65f0927a2b8a8a3942f1e4ff79daa3e727eaf87c
4
+ data.tar.gz: 65370863023d0d99487ca65d9622fdf9d5339f48
5
5
  SHA512:
6
- metadata.gz: 3d75bdcd348a45c45502d0d7632329717185b730ecae77f536c304421fc8777fcd64a5c392df13d2f1e7b32303a9fb93265f377594bd0cc30d4cea8cf47176d5
7
- data.tar.gz: 82898b819d8bcc33a2e04f5da1f05da53641c5a1c3d4bcadbfc614286989f063a8a3ad85d0d5b3705b1ed105ed72415c73b36c5103c7282065552ab6b1de3011
6
+ metadata.gz: 0262e954cd3f5fb9f79f1423c65da244402729279af0e6ca9e1184d24c91bc2623b48a165343139e4c257ea84fa51a0c594f0664d060be85f1294b8e74fa8e49
7
+ data.tar.gz: fb73ad8ffdbbf81842e2fc9b9503ae9efb04fa2192dcfba4076f510a01d0890338bdfd5094e1268a16a2361611e55aad8ff7cde44ace5f0051268fc0660e66bd
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Prerender Rails [![Build Status](https://travis-ci.org/collectiveip/prerender_rails.png)](https://travis-ci.org/collectiveip/prerender_rails)
1
+ Prerender Rails [![Build Status](https://travis-ci.org/collectiveip/prerender_rails.png)](https://travis-ci.org/collectiveip/prerender_rails) [![Gem Version](https://badge.fury.io/rb/prerender_rails.png)](http://badge.fury.io/rb/prerender_rails)
2
2
  ===========================
3
3
 
4
4
  Are you using backbone, angular, emberjs, etc, but you're unsure about the SEO implications?
@@ -64,8 +64,8 @@ module Rack
64
64
  if should_show_prerendered_page(env)
65
65
  prerendered_response = get_prerendered_page_response(env)
66
66
 
67
- if prerendered_response && prerendered_response.is_a?(Net::HTTPSuccess)
68
- response = Rack::Response.new(prerendered_response.body, 200, [])
67
+ if prerendered_response
68
+ response = Rack::Response.new(prerendered_response.body, prerendered_response.code, [])
69
69
  return response.finish
70
70
  end
71
71
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "prerender_rails"
5
- spec.version = "0.1.2"
5
+ spec.version = "0.1.3"
6
6
  spec.authors = ["Todd Hooper"]
7
7
  spec.email = ["todd@collectiveip.com"]
8
8
  spec.description = %q{Rails middleware to prerender your javascript heavy pages on the fly by a phantomjs service}
@@ -13,12 +13,13 @@ describe Rack::Prerender do
13
13
  @prerender = Rack::Prerender.new(@app)
14
14
  end
15
15
 
16
- it "should return a prerendered reponse for a crawler" do
16
+ it "should return a prerendered response for a crawler with the returned status code" do
17
17
  request = Rack::MockRequest.env_for "/", "HTTP_USER_AGENT" => bot
18
- stub_request(:get, @prerender.build_api_url(request)).to_return(:body => "<html></html>")
18
+ stub_request(:get, @prerender.build_api_url(request)).to_return(:body => "<html></html>", :status => 201)
19
19
  response = Rack::Prerender.new(@app).call(request)
20
20
 
21
21
  assert_equal response[2].body, ["<html></html>"]
22
+ assert_equal response[2].status, 201
22
23
  end
23
24
 
24
25
  it "should return a prerendered reponse if user is a bot by checking for _escaped_fragment_" do
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: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Hooper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-14 00:00:00.000000000 Z
11
+ date: 2013-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack