selenium_download_helper 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +73 -76
- data/lib/selenium_download_helper/version.rb +1 -1
- data/lib/selenium_download_helper.rb +9 -7
- data/selenium_download_helper.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa84829d0e2102bcba993d16dfad54b041afb314f99a271e8f2575398d1ad413
|
4
|
+
data.tar.gz: e4512c0f922cec27f3bfa779d8531a6cebdb95f1132caa5b74cce96891692ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97a0da523c03be13c9fba644030934346382c2cbc78b7f927a14a2e359076188301249ef8589659faec89b7d4e54dbdc21cc70947a387ef8ad029031c8dd852e
|
7
|
+
data.tar.gz: 6e3cd2dc07cfcc004803e3b08332321b0a064fdf648ec9e955f6c98e77f12c35604c936f29036f55e6cd51747c6da490ace90a9e2ef1c04556fa43e866e9ab45
|
data/Gemfile.lock
CHANGED
@@ -1,91 +1,87 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
selenium_download_helper (1.
|
4
|
+
selenium_download_helper (1.1.0)
|
5
5
|
rails (>= 7.0)
|
6
6
|
selenium-webdriver
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (7.1
|
12
|
-
actionpack (= 7.1
|
13
|
-
activesupport (= 7.1
|
11
|
+
actioncable (7.2.1)
|
12
|
+
actionpack (= 7.2.1)
|
13
|
+
activesupport (= 7.2.1)
|
14
14
|
nio4r (~> 2.0)
|
15
15
|
websocket-driver (>= 0.6.1)
|
16
16
|
zeitwerk (~> 2.6)
|
17
|
-
actionmailbox (7.1
|
18
|
-
actionpack (= 7.1
|
19
|
-
activejob (= 7.1
|
20
|
-
activerecord (= 7.1
|
21
|
-
activestorage (= 7.1
|
22
|
-
activesupport (= 7.1
|
23
|
-
mail (>= 2.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
activejob (= 7.1.3.4)
|
31
|
-
activesupport (= 7.1.3.4)
|
32
|
-
mail (~> 2.5, >= 2.5.4)
|
33
|
-
net-imap
|
34
|
-
net-pop
|
35
|
-
net-smtp
|
17
|
+
actionmailbox (7.2.1)
|
18
|
+
actionpack (= 7.2.1)
|
19
|
+
activejob (= 7.2.1)
|
20
|
+
activerecord (= 7.2.1)
|
21
|
+
activestorage (= 7.2.1)
|
22
|
+
activesupport (= 7.2.1)
|
23
|
+
mail (>= 2.8.0)
|
24
|
+
actionmailer (7.2.1)
|
25
|
+
actionpack (= 7.2.1)
|
26
|
+
actionview (= 7.2.1)
|
27
|
+
activejob (= 7.2.1)
|
28
|
+
activesupport (= 7.2.1)
|
29
|
+
mail (>= 2.8.0)
|
36
30
|
rails-dom-testing (~> 2.2)
|
37
|
-
actionpack (7.1
|
38
|
-
actionview (= 7.1
|
39
|
-
activesupport (= 7.1
|
31
|
+
actionpack (7.2.1)
|
32
|
+
actionview (= 7.2.1)
|
33
|
+
activesupport (= 7.2.1)
|
40
34
|
nokogiri (>= 1.8.5)
|
41
35
|
racc
|
42
|
-
rack (>= 2.2.4)
|
36
|
+
rack (>= 2.2.4, < 3.2)
|
43
37
|
rack-session (>= 1.0.1)
|
44
38
|
rack-test (>= 0.6.3)
|
45
39
|
rails-dom-testing (~> 2.2)
|
46
40
|
rails-html-sanitizer (~> 1.6)
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
41
|
+
useragent (~> 0.16)
|
42
|
+
actiontext (7.2.1)
|
43
|
+
actionpack (= 7.2.1)
|
44
|
+
activerecord (= 7.2.1)
|
45
|
+
activestorage (= 7.2.1)
|
46
|
+
activesupport (= 7.2.1)
|
52
47
|
globalid (>= 0.6.0)
|
53
48
|
nokogiri (>= 1.8.5)
|
54
|
-
actionview (7.1
|
55
|
-
activesupport (= 7.1
|
49
|
+
actionview (7.2.1)
|
50
|
+
activesupport (= 7.2.1)
|
56
51
|
builder (~> 3.1)
|
57
52
|
erubi (~> 1.11)
|
58
53
|
rails-dom-testing (~> 2.2)
|
59
54
|
rails-html-sanitizer (~> 1.6)
|
60
|
-
activejob (7.1
|
61
|
-
activesupport (= 7.1
|
55
|
+
activejob (7.2.1)
|
56
|
+
activesupport (= 7.2.1)
|
62
57
|
globalid (>= 0.3.6)
|
63
|
-
activemodel (7.1
|
64
|
-
activesupport (= 7.1
|
65
|
-
activerecord (7.1
|
66
|
-
activemodel (= 7.1
|
67
|
-
activesupport (= 7.1
|
58
|
+
activemodel (7.2.1)
|
59
|
+
activesupport (= 7.2.1)
|
60
|
+
activerecord (7.2.1)
|
61
|
+
activemodel (= 7.2.1)
|
62
|
+
activesupport (= 7.2.1)
|
68
63
|
timeout (>= 0.4.0)
|
69
|
-
activestorage (7.1
|
70
|
-
actionpack (= 7.1
|
71
|
-
activejob (= 7.1
|
72
|
-
activerecord (= 7.1
|
73
|
-
activesupport (= 7.1
|
64
|
+
activestorage (7.2.1)
|
65
|
+
actionpack (= 7.2.1)
|
66
|
+
activejob (= 7.2.1)
|
67
|
+
activerecord (= 7.2.1)
|
68
|
+
activesupport (= 7.2.1)
|
74
69
|
marcel (~> 1.0)
|
75
|
-
activesupport (7.1
|
70
|
+
activesupport (7.2.1)
|
76
71
|
base64
|
77
72
|
bigdecimal
|
78
|
-
concurrent-ruby (~> 1.0, >= 1.
|
73
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
79
74
|
connection_pool (>= 2.2.5)
|
80
75
|
drb
|
81
76
|
i18n (>= 1.6, < 2)
|
77
|
+
logger (>= 1.4.2)
|
82
78
|
minitest (>= 5.1)
|
83
|
-
|
84
|
-
tzinfo (~> 2.0)
|
79
|
+
securerandom (>= 0.3)
|
80
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
85
81
|
base64 (0.2.0)
|
86
82
|
bigdecimal (3.1.8)
|
87
83
|
builder (3.3.0)
|
88
|
-
concurrent-ruby (1.3.
|
84
|
+
concurrent-ruby (1.3.4)
|
89
85
|
connection_pool (2.4.1)
|
90
86
|
crass (1.0.6)
|
91
87
|
date (3.3.4)
|
@@ -112,8 +108,7 @@ GEM
|
|
112
108
|
marcel (1.0.4)
|
113
109
|
mini_mime (1.1.5)
|
114
110
|
mini_portile2 (2.8.7)
|
115
|
-
minitest (5.
|
116
|
-
mutex_m (0.2.0)
|
111
|
+
minitest (5.25.1)
|
117
112
|
net-imap (0.4.14)
|
118
113
|
date
|
119
114
|
net-protocol
|
@@ -124,16 +119,16 @@ GEM
|
|
124
119
|
net-smtp (0.5.0)
|
125
120
|
net-protocol
|
126
121
|
nio4r (2.7.3)
|
127
|
-
nokogiri (1.16.
|
122
|
+
nokogiri (1.16.7)
|
128
123
|
mini_portile2 (~> 2.8.2)
|
129
124
|
racc (~> 1.4)
|
130
|
-
nokogiri (1.16.
|
125
|
+
nokogiri (1.16.7-arm64-darwin)
|
131
126
|
racc (~> 1.4)
|
132
|
-
nokogiri (1.16.
|
127
|
+
nokogiri (1.16.7-x86_64-darwin)
|
133
128
|
racc (~> 1.4)
|
134
129
|
psych (5.1.2)
|
135
130
|
stringio
|
136
|
-
racc (1.8.
|
131
|
+
racc (1.8.1)
|
137
132
|
rack (3.1.7)
|
138
133
|
rack-session (2.0.0)
|
139
134
|
rack (>= 3.0.0)
|
@@ -142,20 +137,20 @@ GEM
|
|
142
137
|
rackup (2.1.0)
|
143
138
|
rack (>= 3)
|
144
139
|
webrick (~> 1.8)
|
145
|
-
rails (7.1
|
146
|
-
actioncable (= 7.1
|
147
|
-
actionmailbox (= 7.1
|
148
|
-
actionmailer (= 7.1
|
149
|
-
actionpack (= 7.1
|
150
|
-
actiontext (= 7.1
|
151
|
-
actionview (= 7.1
|
152
|
-
activejob (= 7.1
|
153
|
-
activemodel (= 7.1
|
154
|
-
activerecord (= 7.1
|
155
|
-
activestorage (= 7.1
|
156
|
-
activesupport (= 7.1
|
140
|
+
rails (7.2.1)
|
141
|
+
actioncable (= 7.2.1)
|
142
|
+
actionmailbox (= 7.2.1)
|
143
|
+
actionmailer (= 7.2.1)
|
144
|
+
actionpack (= 7.2.1)
|
145
|
+
actiontext (= 7.2.1)
|
146
|
+
actionview (= 7.2.1)
|
147
|
+
activejob (= 7.2.1)
|
148
|
+
activemodel (= 7.2.1)
|
149
|
+
activerecord (= 7.2.1)
|
150
|
+
activestorage (= 7.2.1)
|
151
|
+
activesupport (= 7.2.1)
|
157
152
|
bundler (>= 1.15.0)
|
158
|
-
railties (= 7.1
|
153
|
+
railties (= 7.2.1)
|
159
154
|
rails-dom-testing (2.2.0)
|
160
155
|
activesupport (>= 5.0.0)
|
161
156
|
minitest
|
@@ -163,10 +158,10 @@ GEM
|
|
163
158
|
rails-html-sanitizer (1.6.0)
|
164
159
|
loofah (~> 2.21)
|
165
160
|
nokogiri (~> 1.14)
|
166
|
-
railties (7.1
|
167
|
-
actionpack (= 7.1
|
168
|
-
activesupport (= 7.1
|
169
|
-
irb
|
161
|
+
railties (7.2.1)
|
162
|
+
actionpack (= 7.2.1)
|
163
|
+
activesupport (= 7.2.1)
|
164
|
+
irb (~> 1.13)
|
170
165
|
rackup (>= 1.0.0)
|
171
166
|
rake (>= 12.2)
|
172
167
|
thor (~> 1.0, >= 1.2.2)
|
@@ -176,7 +171,7 @@ GEM
|
|
176
171
|
psych (>= 4.0.0)
|
177
172
|
reline (0.5.9)
|
178
173
|
io-console (~> 0.5)
|
179
|
-
rexml (3.3.
|
174
|
+
rexml (3.3.6)
|
180
175
|
strscan
|
181
176
|
rspec (3.10.0)
|
182
177
|
rspec-core (~> 3.10.0)
|
@@ -192,6 +187,7 @@ GEM
|
|
192
187
|
rspec-support (~> 3.10.0)
|
193
188
|
rspec-support (3.10.2)
|
194
189
|
rubyzip (2.3.2)
|
190
|
+
securerandom (0.3.1)
|
195
191
|
selenium-webdriver (4.23.0)
|
196
192
|
base64 (~> 0.2)
|
197
193
|
logger (~> 1.4)
|
@@ -204,12 +200,13 @@ GEM
|
|
204
200
|
timeout (0.4.1)
|
205
201
|
tzinfo (2.0.6)
|
206
202
|
concurrent-ruby (~> 1.0)
|
203
|
+
useragent (0.16.10)
|
207
204
|
webrick (1.8.1)
|
208
205
|
websocket (1.2.11)
|
209
206
|
websocket-driver (0.7.6)
|
210
207
|
websocket-extensions (>= 0.1.0)
|
211
208
|
websocket-extensions (0.1.5)
|
212
|
-
zeitwerk (2.6.
|
209
|
+
zeitwerk (2.6.17)
|
213
210
|
|
214
211
|
PLATFORMS
|
215
212
|
arm64-darwin-22
|
@@ -15,12 +15,12 @@ module SeleniumDownloadHelper
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def wait_for_downloaded(timeout: 10, interval: 0.2, all: false, &block)
|
18
|
+
def wait_for_downloaded(timeout: 10, interval: 0.2, all: false, filename: nil, &block)
|
19
19
|
download_path= mkdownloaddir
|
20
20
|
page.driver.browser.download_path = download_path
|
21
21
|
yield
|
22
|
-
Selenium::WebDriver::Wait.new(timeout: timeout, interval: interval).until { downloaded?(download_path) }
|
23
|
-
downloaded_files(download_path).then { |files| all ? files : files.first }
|
22
|
+
Selenium::WebDriver::Wait.new(timeout: timeout, interval: interval).until { downloaded?(download_path, filename:) }
|
23
|
+
downloaded_files(download_path, filename:).then { |files| all ? files : files.first }
|
24
24
|
end
|
25
25
|
|
26
26
|
private
|
@@ -34,12 +34,14 @@ module SeleniumDownloadHelper
|
|
34
34
|
Dir.mktmpdir('selenium_download_helper__', base_download_dir)
|
35
35
|
end
|
36
36
|
|
37
|
-
def downloaded_files(download_path)
|
38
|
-
Dir[File.join(download_path, '*')]
|
37
|
+
def downloaded_files(download_path, filename: nil)
|
38
|
+
Dir[File.join(download_path, '*')]
|
39
|
+
.map { |filepath| Pathname.new(filepath) }
|
40
|
+
.select { |file| filename.nil? || filename === file.basename.to_s }
|
39
41
|
end
|
40
42
|
|
41
|
-
def downloaded?(download_path)
|
42
|
-
files = downloaded_files(download_path)
|
43
|
+
def downloaded?(download_path, filename: nil)
|
44
|
+
files = downloaded_files(download_path, filename:)
|
43
45
|
files.map(&:to_s).grep(/\.crdownload$/).none? && files.any?
|
44
46
|
end
|
45
47
|
end
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
-
spec.metadata["changelog_uri"] = "https://github.com/SonicGarden/selenium_download_helper/
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/SonicGarden/selenium_download_helper/releases"
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
22
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium_download_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki77
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,7 +66,7 @@ licenses:
|
|
66
66
|
metadata:
|
67
67
|
homepage_uri: https://github.com/SonicGarden/selenium_download_helper
|
68
68
|
source_code_uri: https://github.com/SonicGarden/selenium_download_helper
|
69
|
-
changelog_uri: https://github.com/SonicGarden/selenium_download_helper/
|
69
|
+
changelog_uri: https://github.com/SonicGarden/selenium_download_helper/releases
|
70
70
|
post_install_message:
|
71
71
|
rdoc_options: []
|
72
72
|
require_paths:
|