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 +4 -4
- data/README.md +1 -1
- data/lib/prerender_rails.rb +2 -2
- data/prerender_rails.gemspec +1 -1
- data/test/lib/prerender_rails.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65f0927a2b8a8a3942f1e4ff79daa3e727eaf87c
|
4
|
+
data.tar.gz: 65370863023d0d99487ca65d9622fdf9d5339f48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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?
|
data/lib/prerender_rails.rb
CHANGED
@@ -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
|
68
|
-
response = Rack::Response.new(prerendered_response.body,
|
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
|
data/prerender_rails.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "prerender_rails"
|
5
|
-
spec.version = "0.1.
|
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}
|
data/test/lib/prerender_rails.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2013-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|