ferrumwizard 0.2.1 → 0.3.0

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: 2b8068fb08b6eb2a2c96e42a22e4e2290484fa98ca27271b3731d858e39d7bf5
4
- data.tar.gz: a939996048a46f321bf66c4dc86991f9a37c91393599782e9d3a147a473e2216
3
+ metadata.gz: 16a5b0bedff31cf75df672bb9234b30104006eb2353bc2a035d9a4cb06cce082
4
+ data.tar.gz: eb674866a070802be1c2009d8a7389d0798ae2010521b8370e62bbe780fc65aa
5
5
  SHA512:
6
- metadata.gz: 17c6c8faf26098abcbd716cedb7ba4a4c9d935595af6c4e1626887b3a465ab6632d68502f4f01f5f61f5af59a78c0a629da36e4ea6c0b11a35d1ce1f994872d1
7
- data.tar.gz: 950098796922e1b514df83e92438f533ad92fa6bfb40208001d3b1de12b7810b87fa3f888a8f6733061e5f0672fb8e2919358ca52a11bef12b5bb24b40bcf451
6
+ metadata.gz: b3fd5d76a5aff19304d9d64e91b37089b7a703a0067f41918ab50159643cee556e2adaddf1cc41f11c38d9081c658a42d428709d9ddf5ddc09d71b86ced5f0aa
7
+ data.tar.gz: d1ca5d86310e6d1b1e278fa0c47969045c729a650d49e515c47c11e66ebca9ea0fc14c2b08f18074433ab9134869286fe9970e606729d43f775c571864c60c3a
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/ferrumwizard.rb CHANGED
@@ -5,9 +5,11 @@
5
5
  require 'yaml'
6
6
  require 'rexle'
7
7
  require 'ferrum'
8
+ require 'rxfhelper'
8
9
 
9
10
 
10
11
  class FerrumWizard
12
+ include RXFHelperModule
11
13
 
12
14
  attr_reader :browser, :links, :radio, :buttons, :js_methods
13
15
 
@@ -16,11 +18,12 @@ class FerrumWizard
16
18
 
17
19
  @url, @debug = url, debug
18
20
  @browser = Ferrum::Browser.new headless: headless, timeout: timeout
19
- sleep 3
21
+
22
+ loadx(cookies) if cookies
20
23
 
21
24
  if url then
22
25
 
23
- loadx(cookies) if cookies
26
+ sleep 3
24
27
 
25
28
  @browser.goto(@url)
26
29
  @browser.network.wait_for_idle
@@ -47,16 +50,19 @@ class FerrumWizard
47
50
  # url='https://somewebsite.com'
48
51
  # fw.browser.goto(url)
49
52
  #
50
- def load_cookies(filepath)
53
+ def load_cookies(raws)
54
+
55
+ s = raws.lines.length > 1 ? raws : FileX.read(raws)
56
+ puts 's: ' + s.inspect if @debug
51
57
 
52
- rawcookies = YAML.load(File.read(filepath))
58
+ rawcookies = YAML.load(s)
53
59
 
54
60
  rawcookies.each do |h|
55
61
 
56
62
  if @debug then
57
63
  puts 'name: ' + h['name']
58
64
  puts 'h: ' + h.inspect
59
- sleep 0.7
65
+ sleep 0.4
60
66
  end
61
67
 
62
68
  browser.cookies.set(name: h['name'], value: h['value'],
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ferrumwizard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  FK+cyrQNA9DLJYJuz6uO7Z+gXZWjwAO38LUwF01w49asSv/5ZH2HH/EauX5xWpe+
36
36
  ry6lYQlb8j50Iys5elAy1p0i
37
37
  -----END CERTIFICATE-----
38
- date: 2022-03-30 00:00:00.000000000 Z
38
+ date: 2022-04-13 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rexle
metadata.gz.sig CHANGED
Binary file