nanoc-core 4.11.18 → 4.11.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nanoc/core/temp_filename_factory.rb +6 -2
- data/lib/nanoc/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5609a4d82cab318b327443ab017ec28ace7a23f0766176df6e289c7c757138e
|
4
|
+
data.tar.gz: 4646c4338db2b0fe0a46b0b604205796c154d51c7f5f77c5b59d2031fd806877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d387e1b5fbd4ed31ac03f6eb0510238f4e8e92a615b1c38351fa2e7c1f785e7f2d9ac013c51c48a1f0f6e32a02c8b49d20f9a48e324ed07bc45c054246cdda62
|
7
|
+
data.tar.gz: 6789e6da893cb64eb032c110f244de514c56143df96c8865b2a2903ffcbbbb2a242c60ee46eca40fb3bb1e77e11c1febdc7ebbe675d428ce9e41e419f5683f0d
|
@@ -14,6 +14,7 @@ module Nanoc
|
|
14
14
|
def initialize
|
15
15
|
@counts = {}
|
16
16
|
@root_dir = Dir.mktmpdir('nanoc')
|
17
|
+
@mutex = Mutex.new
|
17
18
|
end
|
18
19
|
|
19
20
|
# @param [String] prefix A string prefix to include in the temporary
|
@@ -21,8 +22,11 @@ module Nanoc
|
|
21
22
|
#
|
22
23
|
# @return [String] A new unused filename
|
23
24
|
def create(prefix)
|
24
|
-
count =
|
25
|
-
@
|
25
|
+
count = nil
|
26
|
+
@mutex.synchronize do
|
27
|
+
count = @counts.fetch(prefix, 0)
|
28
|
+
@counts[prefix] = count + 1
|
29
|
+
end
|
26
30
|
|
27
31
|
dirname = File.join(@root_dir, prefix)
|
28
32
|
filename = File.join(@root_dir, prefix, count.to_s)
|
data/lib/nanoc/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.11.
|
4
|
+
version: 4.11.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|