gastly 1.0.0 → 1.0.1
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/gastly.gemspec +3 -1
- data/lib/gastly/screenshot.rb +7 -3
- data/lib/gastly/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34d8fc80985ccb279101b3b66ef09fdb460ed934
|
|
4
|
+
data.tar.gz: 354e2abb36088e5d2e43da016952b8dd806a4d7e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b1efd1a7c471d3158f1a0aea37b47740ed8e8a843ab3eaa08fda2af1d32279195ad8268d9c86edcecd62895d2c5123e6811f87c08cc522cee9c7bf6d70bbd95
|
|
7
|
+
data.tar.gz: 3666679498a77e264607ac86875bec7456bac2371f5945516d7fe17ebe43e82128d96e13c15509059c7c22ad6ddca3ca4e99085b118bb3a2716753af1fa1e2a6
|
data/CHANGELOG.md
CHANGED
data/gastly.gemspec
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
|
|
4
|
+
require 'gastly/version'
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'gastly'
|
|
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
19
|
spec.require_paths = ['lib']
|
|
20
20
|
|
|
21
|
+
spec.required_ruby_version = '>= 2.1.0'
|
|
22
|
+
|
|
21
23
|
spec.add_development_dependency 'bundler'
|
|
22
24
|
spec.add_development_dependency 'rake', '~> 10.0'
|
|
23
25
|
spec.add_development_dependency 'rubocop'
|
data/lib/gastly/screenshot.rb
CHANGED
|
@@ -8,12 +8,12 @@ module Gastly
|
|
|
8
8
|
|
|
9
9
|
attr_reader :image
|
|
10
10
|
attr_writer :timeout, :browser_width, :browser_height
|
|
11
|
-
attr_accessor :url, :selector, :cookies, :proxy_host, :proxy_port
|
|
11
|
+
attr_accessor :url, :selector, :cookies, :proxy_host, :proxy_port, :phantomjs_options
|
|
12
12
|
|
|
13
13
|
# @param url [String] The full url to the site
|
|
14
14
|
def initialize(url, **kwargs)
|
|
15
15
|
hash = Gastly::Utils::Hash.new(kwargs)
|
|
16
|
-
hash.assert_valid_keys(:timeout, :browser_width, :browser_height, :selector, :cookies, :proxy_host, :proxy_port)
|
|
16
|
+
hash.assert_valid_keys(:timeout, :browser_width, :browser_height, :selector, :cookies, :proxy_host, :proxy_port, :phantomjs_options)
|
|
17
17
|
|
|
18
18
|
@url = url
|
|
19
19
|
@cookies = kwargs.delete(:cookies)
|
|
@@ -31,7 +31,7 @@ module Gastly
|
|
|
31
31
|
Phantomjs.proxy_host = proxy_host if proxy_host
|
|
32
32
|
Phantomjs.proxy_port = proxy_port if proxy_port
|
|
33
33
|
|
|
34
|
-
output = Phantomjs.run(
|
|
34
|
+
output = Phantomjs.run(options, SCRIPT_PATH.to_s, *prepared_params)
|
|
35
35
|
handle_output(output)
|
|
36
36
|
|
|
37
37
|
Gastly::Image.new(image)
|
|
@@ -46,6 +46,10 @@ module Gastly
|
|
|
46
46
|
|
|
47
47
|
private
|
|
48
48
|
|
|
49
|
+
def options
|
|
50
|
+
[proxy_options, phantomjs_options].join(' ').strip
|
|
51
|
+
end
|
|
52
|
+
|
|
49
53
|
def proxy_options
|
|
50
54
|
return '' if proxy_host.nil? && proxy_port.nil?
|
|
51
55
|
"--proxy=#{proxy_host}:#{proxy_port}"
|
data/lib/gastly/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gastly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikhail Grachev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-11-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
136
136
|
requirements:
|
|
137
137
|
- - ">="
|
|
138
138
|
- !ruby/object:Gem::Version
|
|
139
|
-
version:
|
|
139
|
+
version: 2.1.0
|
|
140
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
requirements:
|
|
142
142
|
- - ">="
|