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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5467dad132759192c6e70376b7c2f7cf5432acdaa1c7448026c28eb64251b7e9
4
- data.tar.gz: 5380c0df4b66f7643fc118f7e69be0384651e1c98fc934189967a8317ca61439
3
+ metadata.gz: def57c20317984adb28e0c8172d28df8bb4e476725670ad5419da5220db6d8a0
4
+ data.tar.gz: 3c540b24dcbb3f3ad6deb2076dcd7bcce80369a86f94b5607a31079f601482e6
5
5
  SHA512:
6
- metadata.gz: d50cafa8b05cb778c76f7d3d727cb8a42bb3bceb6e234f6450001e5d9e8389a41574e34c5e8bf01232d80f26befa595e96d6b99dd52d61b62c7fc4cf6de11d43
7
- data.tar.gz: c76971e08269761e80b6a33b5dc51787328a6678c83f79906405992121d655c7e3846c01756ac8ff73d5528031aece3cb9b9b4471e78208a9dfeb4b94250e1f8
6
+ metadata.gz: 165cdbdc81f4669786265d56cd9772d3ea1a53be066f14f1ecf902437f45fd880d42682651ee6fc3aa2e6cffa711dab2e6f761e68ab42190b53d96ca9657ceb8
7
+ data.tar.gz: 45290576fb05da2cdb4cfa14aa5c738253302fc2ec60362194de1445359a0db8aa5f3e638e82f8d49f25310b23046eebad4a642c8f08f20fc7322de64584ea95
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- selenium_download_helper (1.2.0)
4
+ selenium_download_helper (1.2.1)
5
5
  rails (>= 7.0)
6
6
  selenium-webdriver
7
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SeleniumDownloadHelper
4
- VERSION = '1.2.0'
4
+ VERSION = '1.2.1'
5
5
  end
@@ -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|\/downloads.html)$/
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
- files = downloaded_files(download_path, filename:)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium_download_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - aki77