mores 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mores/patch/file_utils.rb +11 -0
- data/lib/mores/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56db0243472baf8e65ff96edd88956f16cf605fa
|
4
|
+
data.tar.gz: 95eed517c10f3be24f9d59a4e06c581bdc01f678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4952f2d0e315fa61105302ceec5a40970e55e5d8e882093fa109358fac69608e5a47bccbbb750adf500b37f919f1b758d604772cb6e30a4bc6057d13cabe6276
|
7
|
+
data.tar.gz: ba792a2bedeb40272972f89835ebda4dfa958263fb6703a2137e4ed5b361b133c799f86c309d3eff95a22dffb9e5b2f0ab00c6625021fe4ad133a8282fb87ada
|
@@ -15,6 +15,17 @@ module Mores::Patch::FileUtils
|
|
15
15
|
false
|
16
16
|
end
|
17
17
|
|
18
|
+
def safe_write(path, string)
|
19
|
+
[path, File.write(path, string, mode: File::CREAT | File::EXCL | File::WRONLY)]
|
20
|
+
rescue Errno::EEXIST
|
21
|
+
path_fmt ||= File.basename(path, '.*').tap do |base|
|
22
|
+
break path.insert path.rindex(base) + base.length, '%s'
|
23
|
+
end
|
24
|
+
suffix ||= '_0'
|
25
|
+
path = path_fmt % suffix.next!
|
26
|
+
retry
|
27
|
+
end
|
28
|
+
|
18
29
|
private
|
19
30
|
|
20
31
|
def stream_blksize(*streams)
|
data/lib/mores/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mores
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Petter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|