prerender_rails 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 925e1ebbfc55c0ca7d4192ec5ca9a06da0a139f6
4
- data.tar.gz: 925495cbd931bcd6224788a766b86a8e1e2d6740
3
+ metadata.gz: b02ea13b681d4f5e6a8f66e569a8b85880a856c3
4
+ data.tar.gz: c274987c34aa4001c1989d5c8e2d1243e640bcae
5
5
  SHA512:
6
- metadata.gz: 4db41e6ae70e3350b67654b5b3ae51184bfba4995cd24f324d1ef07d906ae38aee0a062a2cd48ce615e3406cdb5fb364c45783d13b75353838b921f8a30697e2
7
- data.tar.gz: 443608a9803cdc217181d22fa0d5d8b2f50ebb21d083d74bb3aa8dcdf14a38ad2b760b64ad5ac6b9ca5d32e6db3673f11fdd5a76445d5f0e8aa1f7d1d36de85d
6
+ metadata.gz: 9a61bc9b14d443ed658f1fb4bf4437ce2a176d6aabaae92d4968732c3b1cd64d0b24df498c0b96afc03156bff8cfb62c9e7049a2aebe581d63ef3b694001053b
7
+ data.tar.gz: 8d5a5eb19f54d5f0587bf5b691467d3eba61dba4dac2a4d3e810e6988df92f558425079d97b01809493de2a59ca8fc35e13c178d9b42b595c966a9bcb0fe80e0
data/README.md CHANGED
@@ -21,6 +21,12 @@ And in `config/environment/production.rb`, add this line:
21
21
  config.middleware.use Rack::Prerender
22
22
  ```
23
23
 
24
+ or if you have an account on [prerender.io](http://prerender.io) and want to use your token:
25
+
26
+ ```ruby
27
+ config.middleware.use Rack::Prerender, prerender_token: 'YOUR_TOKEN'
28
+ ```
29
+
24
30
  ## How it works
25
31
  1. Check to make sure we should show a prerendered page
26
32
  1. Check if the request is from a crawler (`_escaped_fragment_` or agent string)
@@ -27,6 +27,8 @@ module Rack
27
27
  '.pdf',
28
28
  '.doc',
29
29
  '.txt',
30
+ '.ico',
31
+ '.rss',
30
32
  '.zip',
31
33
  '.mp3',
32
34
  '.rar',
@@ -126,6 +128,7 @@ module Rack
126
128
  url = URI.parse(build_api_url(env))
127
129
  headers = { 'User-Agent' => env['HTTP_USER_AGENT'] }
128
130
  headers['X-Prerender-Token'] = ENV['PRERENDER_TOKEN'] if ENV['PRERENDER_TOKEN']
131
+ headers['X-Prerender-Token'] = @options[:prerender_token] if @options[:prerender_token]
129
132
  req = Net::HTTP::Get.new(url.request_uri, headers)
130
133
  response = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
131
134
  rescue
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "prerender_rails"
5
- spec.version = "0.1.12"
5
+ spec.version = "0.1.13"
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}
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.12
4
+ version: 0.1.13
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-11-21 00:00:00.000000000 Z
11
+ date: 2013-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack