nanoc-core 4.12.13 → 4.12.14
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 +4 -4
- data/lib/nanoc/core/action_sequence_store.rb +1 -1
- data/lib/nanoc/core/binary_compiled_content_cache.rb +1 -1
- data/lib/nanoc/core/checksum_store.rb +1 -1
- data/lib/nanoc/core/dependency_store.rb +1 -1
- data/lib/nanoc/core/outdatedness_store.rb +1 -1
- data/lib/nanoc/core/store.rb +29 -3
- data/lib/nanoc/core/textual_compiled_content_cache.rb +1 -1
- data/lib/nanoc/core/version.rb +1 -1
- data/lib/nanoc/core.rb +1 -0
- 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: f6002d238861027abd84a4b7499c56f95be1e8bf3dec412eb21051c91c11fcce
|
4
|
+
data.tar.gz: 3788262a93f33920e549372a34d5fcacc4a2c6d120d3acf1562499eaaaca0cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 869cddca22933872511ec0b10d7a09c9d37ff3dd89de4340f88b2d6fcceee725779d0c0dd9e891f2c28e2a25adb6f7a909f378537d8d88bd5a4f128fc76b86de
|
7
|
+
data.tar.gz: 208bd267925b4d51df67bd0293fe6f903671089f4899c529fc63cc8d5ecd0130c434662211b2e232e115bb532a2234301c6c44e5b74fff4acfc74e93288d703d
|
@@ -11,7 +11,7 @@ module Nanoc
|
|
11
11
|
|
12
12
|
contract C::KeywordArgs[config: Nanoc::Core::Configuration] => C::Any
|
13
13
|
def initialize(config:)
|
14
|
-
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'rule_memory'),
|
14
|
+
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'rule_memory'), 2)
|
15
15
|
|
16
16
|
@action_sequences = {}
|
17
17
|
end
|
@@ -11,7 +11,7 @@ module Nanoc
|
|
11
11
|
|
12
12
|
contract C::KeywordArgs[config: Nanoc::Core::Configuration] => C::Any
|
13
13
|
def initialize(config:)
|
14
|
-
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'binary_content'),
|
14
|
+
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'binary_content'), 3)
|
15
15
|
|
16
16
|
@cache = {}
|
17
17
|
end
|
@@ -16,7 +16,7 @@ module Nanoc
|
|
16
16
|
|
17
17
|
contract C::KeywordArgs[config: Nanoc::Core::Configuration, objects: C::IterOf[c_obj]] => C::Any
|
18
18
|
def initialize(config:, objects:)
|
19
|
-
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'checksums'),
|
19
|
+
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'checksums'), 3)
|
20
20
|
|
21
21
|
@objects = objects
|
22
22
|
|
@@ -42,7 +42,7 @@ module Nanoc
|
|
42
42
|
|
43
43
|
contract Nanoc::Core::ItemCollection, Nanoc::Core::LayoutCollection, Nanoc::Core::Configuration => C::Any
|
44
44
|
def initialize(items, layouts, config)
|
45
|
-
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'dependencies'),
|
45
|
+
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'dependencies'), 6)
|
46
46
|
|
47
47
|
@config = config
|
48
48
|
@items = items
|
@@ -8,7 +8,7 @@ module Nanoc
|
|
8
8
|
|
9
9
|
contract C::KeywordArgs[config: Nanoc::Core::Configuration] => C::Any
|
10
10
|
def initialize(config:)
|
11
|
-
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'outdatedness'),
|
11
|
+
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'outdatedness'), 2)
|
12
12
|
|
13
13
|
@outdated_refs = Set.new
|
14
14
|
end
|
data/lib/nanoc/core/store.rb
CHANGED
@@ -128,12 +128,16 @@ module Nanoc
|
|
128
128
|
self.data = read_obj_from_file(data_filename)
|
129
129
|
end
|
130
130
|
|
131
|
-
def write_obj_to_file(
|
132
|
-
|
131
|
+
def write_obj_to_file(filename, obj)
|
132
|
+
data = Marshal.dump(obj)
|
133
|
+
compressed_data = Zlib::Deflate.deflate(data, Zlib::BEST_SPEED)
|
134
|
+
write_data_to_file(filename, compressed_data)
|
133
135
|
end
|
134
136
|
|
135
137
|
def read_obj_from_file(fn)
|
136
|
-
|
138
|
+
compressed_data = File.binread(fn)
|
139
|
+
data = Zlib::Inflate.inflate(compressed_data)
|
140
|
+
Marshal.load(data)
|
137
141
|
end
|
138
142
|
|
139
143
|
def version_filename
|
@@ -143,6 +147,28 @@ module Nanoc
|
|
143
147
|
def data_filename
|
144
148
|
"#{filename}.data.db"
|
145
149
|
end
|
150
|
+
|
151
|
+
def write_data_to_file(filename, data)
|
152
|
+
basename = File.basename(filename)
|
153
|
+
dirname = File.dirname(filename)
|
154
|
+
|
155
|
+
# Write to a temporary file first, and then (atomically) move it into
|
156
|
+
# place.
|
157
|
+
Tempfile.open(".#{basename}", dirname) do |temp_file|
|
158
|
+
temp_file.binmode
|
159
|
+
|
160
|
+
# Write the data as a stream, because File.binwrite can’t
|
161
|
+
# necessarily deal with writing that much data all at once.
|
162
|
+
#
|
163
|
+
# See https://github.com/nanoc/nanoc/issues/1635.
|
164
|
+
reader = StringIO.new(data)
|
165
|
+
IO.copy_stream(reader, temp_file)
|
166
|
+
temp_file.close
|
167
|
+
|
168
|
+
# Rename (atomic)
|
169
|
+
File.rename(temp_file.path, filename)
|
170
|
+
end
|
171
|
+
end
|
146
172
|
end
|
147
173
|
end
|
148
174
|
end
|
@@ -11,7 +11,7 @@ module Nanoc
|
|
11
11
|
|
12
12
|
contract C::KeywordArgs[config: Nanoc::Core::Configuration] => C::Any
|
13
13
|
def initialize(config:)
|
14
|
-
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'compiled_content'),
|
14
|
+
super(Nanoc::Core::Store.tmp_path_for(config: config, store_name: 'compiled_content'), 4)
|
15
15
|
|
16
16
|
@cache = {}
|
17
17
|
end
|
data/lib/nanoc/core/version.rb
CHANGED
data/lib/nanoc/core.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.12.
|
4
|
+
version: 4.12.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|