browsed 0.1.7 → 0.1.8

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
  SHA256:
3
- metadata.gz: 923fe9c7ef4eaac734b6e8467da827d864905d76ac3fec4ba5547913e0249798
4
- data.tar.gz: 6f279fa98e09d546a57f68482ca391ee83ef4178d07b0440099cb3c58f709d79
3
+ metadata.gz: 4631a9e5e0982106f635f4ac515e7cf4e25259df9cbf14b40526e30fa1737147
4
+ data.tar.gz: 025df085a9ccdb79abb3282c20901831195e098e36182a2592dd62585e888f0f
5
5
  SHA512:
6
- metadata.gz: 141010d9e2392434651ad2e8c4b8bcdc30dbb476439bc807dfc5324f756a288b884fbe4c982d5fa8934893e0d9c3468e5a19394edc3295c67fa0c6bfd6edf0da
7
- data.tar.gz: dc99d00ff39f520765770a342110bac34e9d267347d6087b794931aeaf0118c5011b241c33788eb85491e9ccc55b79540085a25a840d166db5afccc49cc015c4
6
+ metadata.gz: b6802e8ba20979342205b7bd4a5a111cbca200269dcbc49521a17e53a6b4743a46901d2b601defb48bcc4b9364c62b74ade6ef7dd145f80ea9e2521190355697
7
+ data.tar.gz: 988985ccb8ba4f478c7599e9d5d37a27e36b45446ffb82d13661d532d64a8b8869c6f16efb175e9d40dfaec8d9553116e2aa876f0656c648f54471c5b284d4ce
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- browsed (0.1.7)
4
+ browsed (0.1.8)
5
5
  agents
6
6
  capybara (~> 3.4, >= 3.4.1)
7
7
  poltergeist (~> 1.18, >= 1.18.1)
@@ -13,7 +13,7 @@ GEM
13
13
  addressable (2.5.2)
14
14
  public_suffix (>= 2.0.2, < 4.0)
15
15
  agents (0.1.2)
16
- capybara (3.4.2)
16
+ capybara (3.6.0)
17
17
  addressable
18
18
  mini_mime (>= 0.1.3)
19
19
  nokogiri (~> 1.8)
@@ -29,7 +29,7 @@ GEM
29
29
  launchy (2.4.3)
30
30
  addressable (~> 2.3)
31
31
  method_source (0.9.0)
32
- mini_mime (1.0.0)
32
+ mini_mime (1.0.1)
33
33
  mini_portile2 (2.3.0)
34
34
  nokogiri (1.8.4)
35
35
  mini_portile2 (~> 2.3.0)
@@ -40,26 +40,26 @@ GEM
40
40
  pry (0.11.3)
41
41
  coderay (~> 1.1.0)
42
42
  method_source (~> 0.9.0)
43
- public_suffix (3.0.2)
43
+ public_suffix (3.0.3)
44
44
  rack (2.0.5)
45
45
  rack-test (1.1.0)
46
46
  rack (>= 1.0, < 3)
47
47
  rake (10.5.0)
48
- rspec (3.7.0)
49
- rspec-core (~> 3.7.0)
50
- rspec-expectations (~> 3.7.0)
51
- rspec-mocks (~> 3.7.0)
52
- rspec-core (3.7.1)
53
- rspec-support (~> 3.7.0)
54
- rspec-expectations (3.7.0)
48
+ rspec (3.8.0)
49
+ rspec-core (~> 3.8.0)
50
+ rspec-expectations (~> 3.8.0)
51
+ rspec-mocks (~> 3.8.0)
52
+ rspec-core (3.8.0)
53
+ rspec-support (~> 3.8.0)
54
+ rspec-expectations (3.8.1)
55
55
  diff-lcs (>= 1.2.0, < 2.0)
56
- rspec-support (~> 3.7.0)
57
- rspec-mocks (3.7.0)
56
+ rspec-support (~> 3.8.0)
57
+ rspec-mocks (3.8.0)
58
58
  diff-lcs (>= 1.2.0, < 2.0)
59
- rspec-support (~> 3.7.0)
60
- rspec-support (3.7.1)
59
+ rspec-support (~> 3.8.0)
60
+ rspec-support (3.8.0)
61
61
  rubyzip (1.2.1)
62
- selenium-webdriver (3.13.1)
62
+ selenium-webdriver (3.14.0)
63
63
  childprocess (~> 0.5)
64
64
  rubyzip (~> 1.2)
65
65
  websocket-driver (0.7.0)
@@ -92,6 +92,8 @@ module Browsed
92
92
  elsif selenium?
93
93
  if firefox_browser?
94
94
  register_firefox_driver(driver_options: driver_options)
95
+ elsif firefox_headless_browser?
96
+ register_firefox_driver(driver_options: driver_options.merge(headless: true))
95
97
  elsif chrome_browser?
96
98
  self.driver = :selenium_chrome
97
99
  register_chrome_driver(driver_options: driver_options)
@@ -111,6 +113,10 @@ module Browsed
111
113
  self.browser.to_sym.eql?(:firefox)
112
114
  end
113
115
 
116
+ def firefox_headless_browser?
117
+ self.browser.to_sym.eql?(:firefox_headless)
118
+ end
119
+
114
120
  def chrome_browser?
115
121
  self.browser.to_sym.eql?(:chrome)
116
122
  end
@@ -3,6 +3,7 @@ module Browsed
3
3
 
4
4
  private
5
5
  def register_firefox_driver(driver_options: {}, timeout: 60, debug: false)
6
+ headless = driver_options.fetch(:headless, false)
6
7
  download_path = driver_options.fetch(:download_path, self.configuration.download_path)
7
8
  private_browsing = driver_options.fetch(:private_browsing, false)
8
9
 
@@ -25,6 +26,7 @@ module Browsed
25
26
 
26
27
  profile = firefox_proxy_options(profile)
27
28
  options = Selenium::WebDriver::Firefox::Options.new(profile: profile)
29
+ options.args << "--headless" if headless
28
30
 
29
31
  Capybara.register_driver self.driver do |app|
30
32
  Capybara::Selenium::Driver.new(app, browser: :firefox, options: options)
@@ -1,3 +1,3 @@
1
1
  module Browsed
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browsed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-01 00:00:00.000000000 Z
11
+ date: 2018-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara