arachnid2 0.3.3 → 0.3.4

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: 43dfe9fb096f5b1f09a3a3b8c3585f85683bea93f359870122e758dc06c1fdbe
4
- data.tar.gz: 8b5df452bb9ab7db403a9fe5097f576f570a188d43f98da3181dbc72369fa94f
3
+ metadata.gz: 917f030ae3bfe4eb2183020eaab33463abd80940f2d3ad228ba7e86fcb9d1c3d
4
+ data.tar.gz: dd7f349e22f52cf54c45740c4393371f9547c7b5f649048de92863e6a41facc1
5
5
  SHA512:
6
- metadata.gz: ffce09a241a86b6bfc3543a9609c8d210a967759030f8db2924a1bab7b0e35b03a82b4f51a69208a203c37b09b0103618be83a7bdb5a1fd81532d76a20f8c14c
7
- data.tar.gz: 4b2a387d0b602e8463c2a7af53989fc0a13d750315bc9bb02579e5e00eb2f761f3df842fed08be006656cb3160b1aef0321c24de8afc264596fa01b831496b20
6
+ metadata.gz: d868813ceba88a7a078e666626c5de3bad85dbf3b2e834626dab9672f6a5b4f32858c0262bc46831b4c7294e4b8b349cfeaab8ef7625eeada588e9604cfdc525
7
+ data.tar.gz: 1c1b3221ba6db4a12673197162e2be0328879124bd5280f71c63a34d801d4ed74f0cf6526eaff197cca7d805c1dc370f511c66e37467b42856735fc421bfa586
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arachnid2 (0.3.2)
4
+ arachnid2 (0.3.4)
5
5
  addressable
6
6
  adomain
7
7
  bloomfilter-rb
data/README.md CHANGED
@@ -212,6 +212,21 @@ And it accepts an argument to make browse headlessly
212
212
  opts = { headless: true }
213
213
  ```
214
214
 
215
+ ##### `agent`
216
+
217
+ It accepts an argument mapped to Webdriver::UserAgent::Driver's `agent` option
218
+
219
+ ```ruby
220
+ opts = { agent: :desktop }
221
+ ```
222
+ ##### `orientation`
223
+
224
+ And it accepts an argument mapped to Webdriver::UserAgent::Driver's `orientation` option
225
+
226
+ ```ruby
227
+ opts = { orientation: :landscape }
228
+ ```
229
+
215
230
  ##### `followlocation` and `max_concurrency`
216
231
 
217
232
  These options do not apply to Watir, and will be ignored.
@@ -1,3 +1,3 @@
1
1
  class Arachnid2
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -1,5 +1,8 @@
1
1
  class Arachnid2
2
2
  class Watir
3
+ DEFAULT_AGENT = :desktop
4
+ DEFAULT_ORIENTATION = :landscape
5
+
3
6
  include Arachnid2::Exoskeleton
4
7
 
5
8
  def initialize(url)
@@ -73,11 +76,15 @@ class Arachnid2
73
76
 
74
77
  def driver
75
78
  unless @driver
76
- language = @options.dig(:headers, "Accept-Language") || DEFAULT_LANGUAGE
77
- user_agent = @options.dig(:headers, "User-Agent") || DEFAULT_USER_AGENT
79
+ language = @options.dig(:headers, "Accept-Language") || DEFAULT_LANGUAGE
80
+ user_agent = @options.dig(:headers, "User-Agent") || DEFAULT_USER_AGENT
81
+ agent = @options.dig(:agent) || DEFAULT_AGENT
82
+ orientation = @options.dig(:orientation) || DEFAULT_ORIENTATION
78
83
 
79
84
  @driver = Webdriver::UserAgent.driver(
80
85
  browser: browser_type,
86
+ agent: agent,
87
+ orientation: orientation,
81
88
  accept_language_string: language,
82
89
  user_agent_string: user_agent
83
90
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arachnid2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Nissen