selenium_download_helper 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/selenium_download_helper/version.rb +1 -1
- data/lib/selenium_download_helper.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: def57c20317984adb28e0c8172d28df8bb4e476725670ad5419da5220db6d8a0
|
4
|
+
data.tar.gz: 3c540b24dcbb3f3ad6deb2076dcd7bcce80369a86f94b5607a31079f601482e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 165cdbdc81f4669786265d56cd9772d3ea1a53be066f14f1ecf902437f45fd880d42682651ee6fc3aa2e6cffa711dab2e6f761e68ab42190b53d96ca9657ceb8
|
7
|
+
data.tar.gz: 45290576fb05da2cdb4cfa14aa5c738253302fc2ec60362194de1445359a0db8aa5f3e638e82f8d49f25310b23046eebad4a642c8f08f20fc7322de64584ea95
|
data/Gemfile.lock
CHANGED
@@ -10,7 +10,7 @@ require_relative 'selenium_download_helper/errors'
|
|
10
10
|
module SeleniumDownloadHelper
|
11
11
|
extend ActiveSupport::Concern
|
12
12
|
|
13
|
-
TEMPORARY_DOWNLOAD_FILENAME_PATTERN = /(\.crdownload
|
13
|
+
TEMPORARY_DOWNLOAD_FILENAME_PATTERN = /(\.crdownload|^downloads.html)$/
|
14
14
|
|
15
15
|
|
16
16
|
included do
|
@@ -43,11 +43,11 @@ module SeleniumDownloadHelper
|
|
43
43
|
def downloaded_files(download_path, filename: nil)
|
44
44
|
Dir[File.join(download_path, '*')]
|
45
45
|
.map { |filepath| Pathname.new(filepath) }
|
46
|
+
.reject { |file| TEMPORARY_DOWNLOAD_FILENAME_PATTERN.match?(file.basename.to_s) }
|
46
47
|
.select { |file| filename.nil? || filename === file.basename.to_s }
|
47
48
|
end
|
48
49
|
|
49
50
|
def downloaded?(download_path, filename: nil)
|
50
|
-
|
51
|
-
files.map(&:to_s).grep(TEMPORARY_DOWNLOAD_FILENAME_PATTERN).none? && files.any?
|
51
|
+
downloaded_files(download_path, filename:).any?
|
52
52
|
end
|
53
53
|
end
|