fe_core_ext 0.34.0 → 0.35.0

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
  SHA256:
3
- metadata.gz: 6aec43dd19e343c331d5bab87938ebe303be0e3d1537c0115874e53bd19e8920
4
- data.tar.gz: e49433838f1628518bbb90e68c4174eea2f7770a87c8a6f7694a628c0c4597cd
3
+ metadata.gz: a5e7b2064ab60debcbf11816128170f9962d58b665b397357eaf3dd75b3995cd
4
+ data.tar.gz: a471eb764d6d8bbe96e04a64257cfb0b5c8bfa135ab8500780882183fb581880
5
5
  SHA512:
6
- metadata.gz: 6a4dffac05c23c85cf30f6041dad6fd4428ffc8deae06a5bd064025edd99a8193741f36c350b89cc31faeaf8bfc0abc13663640bfef388f912f0af8c61057ae9
7
- data.tar.gz: f48c7eb406fd5c3c722edd9ab0c8766c80550f585c14974009172772c29f7e2eee46ed6613f4e5146144edf1b1e4f0b4743c1e791e6e4e1b14c623bfc6904269
6
+ metadata.gz: 87d710cd1646692765abf857aa7d0a964d442eb1a2885e04322c4371591451dadada346c37ec1c3e9e3b1e20f22d976b8cc080113ff4b57ce577bc9a9b679f49
7
+ data.tar.gz: af73a4c841a38ecdb51a6c1305a780fad8594930d7a854b0c7d1a94269678ee285e0a0831e93de31fe7d0d26054b4d23d0e452f531e8ae1130ecb8b4695a4a33
@@ -31,6 +31,15 @@ module Ferrum
31
31
  wait_for_selector(selector, :at_xpath, timeout)
32
32
  end
33
33
 
34
+ def with(selector, init:nil, wait:3, step:0.1)
35
+ sleep(init) if init
36
+ meth = selector.start_with?("/") ? :at_xpath : :at_css
37
+ until node = send(meth, selector) rescue nil
38
+ (wait -= step) > 0 ? sleep(step) : break
39
+ end
40
+ node
41
+ end
42
+
34
43
  private
35
44
 
36
45
  def wait_for_selector(selector, selector_method, timeout)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FeCoreExt
4
- VERSION = "0.34.0"
4
+ VERSION = "0.35.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fe_core_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.0
4
+ version: 0.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-20 00:00:00.000000000 Z
11
+ date: 2025-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.5.16
134
+ rubygems_version: 3.5.22
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Core class extensions