uniword 1.5.0 → 1.5.1

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: b6093ee22688fc357250708811cdb7035b17ff9a036ec5dd48f86381632b2c72
4
- data.tar.gz: b76ab89a27b22a8a7ed5293f771cedaa165c3263a853f3322eb9f3d06cd0625a
3
+ metadata.gz: d06dcd363ee45ec4dff3dfaa8c56b9062aa478915e429188691bdaac4ee5dbc1
4
+ data.tar.gz: bd597d9b4c1cf37dff1fe4d5092b14ffa5273fe12ec696ea028c4cacc6024b41
5
5
  SHA512:
6
- metadata.gz: dedfcb861076ff92eb99dda31c460e02a4c184fd9ce271abdfc63250dd100235f0889e4705899d2f4566eefa43b329094d77128f9ff9deeae3ff635ca4051218
7
- data.tar.gz: 226c5d1acc52df7f5519935ab2817b73ac71382fb95132e66cd6bfc4f1d912dba604996d0e1eff9996791f0bf0a38df121d27d54e5a012c1236d582580f93484
6
+ metadata.gz: d2dc4f986025a8d4753bbb1bd82e9bb1d13b3cdf6d90804c1778c46763001a0fe9ace019dfc3f559cceb1f399b4ffca94b1f764be46599470accd43e837a1230
7
+ data.tar.gz: e68202ac74cad763250c93261789a2bfa6dad2c7fe906e424fb01948fd51cd6d84d8eb783b6e85fed7637ef2e2d2c1b6230398c36caa1591080bf87f85bbf20a
@@ -73,7 +73,7 @@ module Uniword
73
73
 
74
74
  move_temp_to_output(temp_path, output_path)
75
75
  ensure
76
- FileUtils.rm_f(temp_path) if defined?(temp_path) && temp_path && File.exist?(temp_path)
76
+ remove_temp_file(temp_path)
77
77
  end
78
78
 
79
79
  # Add a file to an existing ZIP archive.
@@ -184,7 +184,7 @@ module Uniword
184
184
 
185
185
  move_temp_to_output(temp_path, output_path)
186
186
  ensure
187
- FileUtils.rm_f(temp_path) if defined?(temp_path) && temp_path && File.exist?(temp_path)
187
+ remove_temp_file(temp_path)
188
188
  end
189
189
 
190
190
  def move_temp_to_output(temp_path, output_path)
@@ -203,6 +203,25 @@ module Uniword
203
203
  end
204
204
  end
205
205
 
206
+ # Best-effort temp file removal with Windows-safe retries. AV
207
+ # scanners and the indexer briefly hold newly-written files; a
208
+ # single `FileUtils.rm_f` can return EACCES and leak the temp.
209
+ def remove_temp_file(temp_path)
210
+ return unless defined?(temp_path) && temp_path
211
+ return unless File.exist?(temp_path)
212
+
213
+ retries = 5
214
+ begin
215
+ FileUtils.rm_f(temp_path)
216
+ rescue Errno::EACCES
217
+ retries -= 1
218
+ if retries.positive?
219
+ sleep(0.3)
220
+ retry
221
+ end
222
+ end
223
+ end
224
+
206
225
  # Validate the content hash.
207
226
  #
208
227
  # @param content [Object] The content to validate
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uniword
4
- VERSION = "1.5.0"
4
+ VERSION = "1.5.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniword
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-21 00:00:00.000000000 Z
11
+ date: 2026-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logger