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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd4fffaf7813aba1bc2544b16ff1cf801f141a293605c4cd3a4f44d26e6baf02
4
- data.tar.gz: a11c2bd8d095dbfcfddc00628cf2a65115184dee3cbedd3ea956d17ce0551f57
3
+ metadata.gz: a5609a4d82cab318b327443ab017ec28ace7a23f0766176df6e289c7c757138e
4
+ data.tar.gz: 4646c4338db2b0fe0a46b0b604205796c154d51c7f5f77c5b59d2031fd806877
5
5
  SHA512:
6
- metadata.gz: 26a6cf153b5cb6c2fc0c12e1597ab4a77dd6ff52cf95fa90e9b636f684caf819e883677cfbe3d60a179f2f87c548be5a4f436c56f2e981b2691908163844628a
7
- data.tar.gz: 2b2dcbaf7d2b0c41a7d9558af9b33c3e7eafa5b8986ec230fb31c74c916beb4912872f80ffa63f02eea9558c60f5e4723ee08d71ece1731ae8d107b5e847b990
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 = @counts.fetch(prefix, 0)
25
- @counts[prefix] = count + 1
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Core
5
- VERSION = '4.11.18'
5
+ VERSION = '4.11.19'
6
6
  end
7
7
  end
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.18
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-06-17 00:00:00.000000000 Z
11
+ date: 2020-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby