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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e380ceb3db540ad9ed92bfa89e2b80d49283996
4
- data.tar.gz: f7c93c82e5a3f8b1d5d15ef2c831d295cd917c78
3
+ metadata.gz: 34d8fc80985ccb279101b3b66ef09fdb460ed934
4
+ data.tar.gz: 354e2abb36088e5d2e43da016952b8dd806a4d7e
5
5
  SHA512:
6
- metadata.gz: abbafd3fef69db4563e9f73840c1e109676c27538b0541c11ba0353a413884b2dee4ac18ea50708b9fd90ad55eeee8b328551365f19b94f557966f347c3ee41b
7
- data.tar.gz: 1b163d12b37ab611656dbd018f6c5845571ed368f766f89474618ab939ea6199582435ddf6f3d1d58743633f87a8852eb12e8effc3471424ec6d7ecd3b692db6
6
+ metadata.gz: 4b1efd1a7c471d3158f1a0aea37b47740ed8e8a843ab3eaa08fda2af1d32279195ad8268d9c86edcecd62895d2c5123e6811f87c08cc522cee9c7bf6d70bbd95
7
+ data.tar.gz: 3666679498a77e264607ac86875bec7456bac2371f5945516d7fe17ebe43e82128d96e13c15509059c7c22ad6ddca3ca4e99085b118bb3a2716753af1fa1e2a6
@@ -1,3 +1,10 @@
1
+ ## 1.0.1 (02/11/2016)
2
+
3
+ ### Enhancements
4
+
5
+ * Added ability to send CLI options to PhantomJS ([#6](https://github.com/mgrachev/gastly/pull/6))
6
+ * Required ruby version is 2.1.0 or higher
7
+
1
8
  ## 1.0.0 (16/07/2016)
2
9
 
3
10
  ### Enhancements
@@ -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
- require_relative 'lib/gastly/version'
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'
@@ -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(proxy_options, SCRIPT_PATH.to_s, *prepared_params)
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}"
@@ -1,3 +1,3 @@
1
1
  module Gastly
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
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.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-07-16 00:00:00.000000000 Z
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: '0'
139
+ version: 2.1.0
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - ">="