mores 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 56db0243472baf8e65ff96edd88956f16cf605fa
4
- data.tar.gz: 95eed517c10f3be24f9d59a4e06c581bdc01f678
3
+ metadata.gz: f4ae50b94b0120512ed6d6aa75d91e31873700a0
4
+ data.tar.gz: 8c5d35a6f481a508fcff8674dc3dcbb28e5ed2d2
5
5
  SHA512:
6
- metadata.gz: 4952f2d0e315fa61105302ceec5a40970e55e5d8e882093fa109358fac69608e5a47bccbbb750adf500b37f919f1b758d604772cb6e30a4bc6057d13cabe6276
7
- data.tar.gz: ba792a2bedeb40272972f89835ebda4dfa958263fb6703a2137e4ed5b361b133c799f86c309d3eff95a22dffb9e5b2f0ab00c6625021fe4ad133a8282fb87ada
6
+ metadata.gz: adb428334b1aef4b165cd10c7b0acec3e5eac2afd54977808ed810b478def9850cb65e00ed1e35b9a8d74d1be5a7d4ced0d2c968ccc7d965b7a75c2d7bbd20b8
7
+ data.tar.gz: a913efe235a7e3a24a328a052c1f7ee760b6e33f991fe7d1228a5910f03edcf6e4e892208500fb671c937ec8bc6c6435d2145caf01160b189072af6be023dd20
@@ -19,10 +19,10 @@ module Mores::Patch::FileUtils
19
19
  [path, File.write(path, string, mode: File::CREAT | File::EXCL | File::WRONLY)]
20
20
  rescue Errno::EEXIST
21
21
  path_fmt ||= File.basename(path, '.*').tap do |base|
22
- break path.insert path.rindex(base) + base.length, '%s'
22
+ break path.insert path.rindex(base) + base.length, '_%d'
23
23
  end
24
- suffix ||= '_0'
25
- path = path_fmt % suffix.next!
24
+ suffix ||= (0..Float::INFINITY).each
25
+ path = path_fmt % suffix.next
26
26
  retry
27
27
  end
28
28
 
@@ -1,3 +1,3 @@
1
1
  module Mores
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mores
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Petter