webshot 0.0.8 → 0.0.9

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: 19a7cddd3d323eeee360c98b4c8f5cee8fce061a
4
- data.tar.gz: 1b9635e641e0f54c3f8eb626db24449195a4b42c
3
+ metadata.gz: 62a9727397129f1b5a062f88bd46a48c1b4dd5db
4
+ data.tar.gz: b8d66c2cad1e39bb66c55b245549486d1e8e52bb
5
5
  SHA512:
6
- metadata.gz: 14b7145f81a687abaecdb085d173b2d48fee57dee1f19fdbfd8e2f6fb386cfb603ba03f3058e30fc4578689a95299dae23c171f50b581bd4562aeaa9c44495ca
7
- data.tar.gz: 55e87693fe5205116982bdc38c4c5ec1f6b8968068845d420ae9dcdcc446024b1f9807d0a3ce88c9f756f6dec82a6620a7cd62f0ea2e38abd8d7b56b4dbfb706
6
+ metadata.gz: 6576d08d90ffe8fc2f129f143cf7f13327af5375e7ceef002646fa9df7f55baa459ebe7d8bfaed128e164359dadd15f3da8722d7f95f5d75903c155f857b807e
7
+ data.tar.gz: 4e76de6199a9a96ba5feb068645733dcc857bfefd667a30c7c43cce9d2e929f4c73580897b5c2f23c6f1263cb7be2e2ba82cc01257ed525a002650b8a2cf9868
data/.travis.yml CHANGED
@@ -3,8 +3,8 @@ cache: bundler
3
3
  before_install:
4
4
  - gem install bundler
5
5
  rvm:
6
- - 2.1.1
7
- - 2.0.0
6
+ - 2.1
7
+ - 2.0
8
8
  - 1.9.3
9
9
  - jruby-19mode # JRuby in 1.9 mode
10
10
  - rbx-2
data/README.md CHANGED
@@ -6,8 +6,10 @@ Captures a web page as a screenshot using Poltergeist, Capybara and PhantomJS.
6
6
 
7
7
  ## Installation
8
8
 
9
- Download and install [PhantomJS](http://phantomjs.org/) and then add PhantomJS to
10
- your PATH. Add this line to your application's Gemfile:
9
+ Download and install [PhantomJS](http://phantomjs.org/),
10
+ add the directory containing the binary to your PATH.
11
+
12
+ Add the `webshot` gem to your Gemfile:
11
13
 
12
14
  gem "webshot"
13
15
 
@@ -65,6 +67,31 @@ end.capture 'https://github.com/username/', 'github.png'
65
67
 
66
68
  ```
67
69
 
70
+ ## Scaling
71
+
72
+ It's not recommended to start multiple PhantomJS concurrently.
73
+ You should serialize requests, treat the process as unreliable and
74
+ monitor it with daemontools, god, monit, etc.
75
+
76
+ Recommended setup:
77
+
78
+ [S3] <-- [CloudFront + 404 handler] <-- User Request
79
+ ^
80
+ |
81
+ Worker <--> [Queue] <-- App
82
+
83
+
84
+ The application triggers screenshot requests which are queued and
85
+ then processed by a background worker (Resque, Sidkiq, etc).
86
+ The worker uploads the images to S3 which are served through
87
+ CloudFront. The CDN should be configured to serve a default
88
+ image (404 handler) with a low TTL to handle screenshot are not
89
+ yet ready or couldn't be generated.
90
+
91
+ Notes:
92
+ - sed 's/S3/Your file hosting service/g'
93
+ - sed 's/CloudFront/Your CDN service/g'
94
+
68
95
  ## Contributing
69
96
 
70
97
  1. Fork it
@@ -76,7 +76,7 @@ module Webshot
76
76
  else
77
77
  raise WebshotError.new("Could not fetch page: #{url.inspect}, error code: #{page.driver.status_code}")
78
78
  end
79
- rescue Capybara::Poltergeist::BrowserError, Capybara::Poltergeist::DeadClient, Capybara::Poltergeist::TimeoutError, Errno::EPIPE => e
79
+ rescue Capybara::Poltergeist::StatusFailError, Capybara::Poltergeist::BrowserError, Capybara::Poltergeist::DeadClient, Capybara::Poltergeist::TimeoutError, Errno::EPIPE => e
80
80
  # TODO: Handle Errno::EPIPE and Errno::ECONNRESET
81
81
  raise WebshotError.new("Capybara error: #{e.message.inspect}")
82
82
  end
@@ -1,3 +1,3 @@
1
1
  module Webshot
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
data/webshot.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "gem-release"
25
25
 
26
26
  spec.add_dependency "activesupport"
27
- spec.add_dependency "poltergeist", "~> 1.5.0"
27
+ spec.add_dependency "poltergeist", "~> 1.6.0"
28
28
  spec.add_dependency "faye-websocket", "~> 0.7.3"
29
- spec.add_dependency "mini_magick", "~> 3.7.0"
29
+ spec.add_dependency "mini_magick", "~> 4.3.3"
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitalie Cherpec
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-21 00:00:00.000000000 Z
11
+ date: 2015-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.5.0
89
+ version: 1.6.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.5.0
96
+ version: 1.6.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: faye-websocket
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 3.7.0
117
+ version: 4.3.3
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 3.7.0
124
+ version: 4.3.3
125
125
  description: Captures a web page as a screenshot using Poltergeist, Capybara and PhantomJS
126
126
  email:
127
127
  - vitalie@penguin.ro