browsed 0.1.1 → 0.1.2

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: 5e4e1bad4aea31f419ea850bb4ccec0b8f8f2691edc62a8ba19eda0fb19b3110
4
- data.tar.gz: 7d4c642d6c6cccc3e334dddb9e77604d0ad16987e13bfe1ae26c381dcdce7b49
3
+ metadata.gz: d7134f8076720d3ac8c06ece828213da9582aa696b5cc3de87a4b2bd761416e0
4
+ data.tar.gz: 792c0861d2825fb28ff44521bfdf2d679f1df8479b769077b70672f3fd3f1807
5
5
  SHA512:
6
- metadata.gz: 0aba65bc0ca76bbba834a7947dbd5c1100c168d9bb969bbc343b89280af7150829c6e2102648fc1a18b9e589fad78f91a639b9fc6789f9006fbf56e6d58bcb23
7
- data.tar.gz: 6f6876c72c3a38723b5cd707ae087d4409985c31196462a3e7b7bc378d785e0a4723ffaf5d00d4f003a2189d597ed569aa1dc285f64956e57804d68abb8c86e1
6
+ metadata.gz: 6df46b2a370d4397247e66cca64f67e93b1ca96fe4b1cdc91ec391d49aebc8f3a3a68f15ddc2df216feafb2d643bf8e48ad83c4a36fc785ebefc5f94d1bf377e
7
+ data.tar.gz: bdc851d90b9e4a64c57093f4bfb6536b0443054ab5acb2ba1c291566b0fc31500d1b0e911d7a0ec671ccc4dd4f26c1ba4fa9f5f9c66a45b608412ce7fe6aed34
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- browsed (0.1.1)
4
+ browsed (0.1.2)
5
5
  agents
6
6
  capybara (~> 3.4, >= 3.4.1)
7
7
  poltergeist (~> 1.18, >= 1.18.1)
@@ -53,6 +53,10 @@ module Browsed
53
53
  Capybara.default_max_wait_time = driver_options.fetch(:wait_time, 30) #seconds
54
54
 
55
55
  self.session = Capybara::Session.new(self.driver)
56
+
57
+ if self.resolution&.any? && !self.driver.eql?(:poltergeist) # Resolution for Poltergeist is set in the driver
58
+ self.session.current_window.resize_to(self.resolution.first, self.resolution.last) # [width, height]
59
+ end
56
60
  else
57
61
  raise Browsed::TooManyProcessesError, "Too many PhantomJS processes running, reached maximum allowed number of #{self.maximum_processes}"
58
62
  end
@@ -148,7 +152,11 @@ module Browsed
148
152
 
149
153
  # Resolution
150
154
  def set_resolution(res)
151
- self.resolution = res&.any? ? res : randomize_resolution
155
+ if res && res.is_a?(Array)
156
+ self.resolution = res
157
+ elsif res && res.is_a?(Symbol) && res.eql?(:randomize)
158
+ self.resolution = randomize_resolution
159
+ end
152
160
  end
153
161
 
154
162
  def randomize_resolution
@@ -1,3 +1,3 @@
1
1
  module Browsed
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browsed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian