nanoc-core 4.11.23 → 4.12.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3785b5628c2b36382f5c6eed88988943304f6d4e8555a4a72c769b11e8f9a21e
|
4
|
+
data.tar.gz: cb562257783d0a0d351822b25c19f9172e134a9910b2fd475ec27a2aa6a13321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5386cce963813faa6c3ac38936b8b2ffce7e3fc94297b5f663a4b8b76df9590e62ee891013abfe665f5f2c06bd14cc754b3c56cbf473b38a079a97eab0e11900
|
7
|
+
data.tar.gz: a038f93b08e01ecad024545e97fde14627c1522ed546d6f2cfebdb06f348ad3fdc4fbb2743d8dbe0a658333ba996a91d2f559bbfd8dbd7e5045d35f07b3302ba
|
data/lib/nanoc/core.rb
CHANGED
@@ -77,14 +77,6 @@ require_relative 'core/core_ext/array'
|
|
77
77
|
require_relative 'core/core_ext/hash'
|
78
78
|
require_relative 'core/core_ext/string'
|
79
79
|
|
80
|
-
# Tracking issue:
|
81
|
-
# https://github.com/nanoc/features/issues/24
|
82
|
-
Nanoc::Core::Feature.define('live_cmd', version: '4.11')
|
83
|
-
|
84
80
|
# Tracking issue:
|
85
81
|
# https://github.com/nanoc/features/issues/40
|
86
|
-
Nanoc::Core::Feature.define('toml', version: '4.
|
87
|
-
|
88
|
-
# Tracking issue:
|
89
|
-
# https://github.com/nanoc/features/issues/20
|
90
|
-
Nanoc::Core::Feature.define('binary_compiled_content_cache', version: '4.11')
|
82
|
+
Nanoc::Core::Feature.define('toml', version: '4.12')
|
@@ -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'), 2)
|
15
15
|
|
16
16
|
@cache = {}
|
17
17
|
end
|
@@ -49,6 +49,11 @@ module Nanoc
|
|
49
49
|
rep_cache = @cache[rep.item.identifier][rep.name]
|
50
50
|
|
51
51
|
content.each do |snapshot, binary_content|
|
52
|
+
# Check
|
53
|
+
if Nanoc::Core::ContractsSupport.enabled? && !File.file?(binary_content.filename)
|
54
|
+
raise Nanoc::Core::Errors::InternalInconsistency, "Binary content at #{binary_content.filename.inspect} does not exist, but is expected to."
|
55
|
+
end
|
56
|
+
|
52
57
|
filename = build_filename(rep, snapshot)
|
53
58
|
rep_cache[snapshot] = filename
|
54
59
|
|
@@ -57,12 +62,8 @@ module Nanoc
|
|
57
62
|
next if binary_content.filename == filename
|
58
63
|
|
59
64
|
# Copy
|
60
|
-
#
|
61
|
-
# NOTE: hardlinking is not an option in this case, because hardlinking
|
62
|
-
# would make it possible for the content to be (inadvertently)
|
63
|
-
# changed outside of Nanoc.
|
64
65
|
FileUtils.mkdir_p(File.dirname(filename))
|
65
|
-
|
66
|
+
smart_cp(binary_content.filename, filename)
|
66
67
|
end
|
67
68
|
end
|
68
69
|
|
@@ -123,6 +124,26 @@ module Nanoc
|
|
123
124
|
string_to_path_component(snapshot_name.to_s),
|
124
125
|
)
|
125
126
|
end
|
127
|
+
|
128
|
+
# NOTE: Similar to ItemRepWriter#smart_cp (but without hardlinking)
|
129
|
+
def smart_cp(from, to)
|
130
|
+
# NOTE: hardlinking is not an option in this case, because hardlinking
|
131
|
+
# would make it possible for the content to be (inadvertently)
|
132
|
+
# changed outside of Nanoc.
|
133
|
+
|
134
|
+
# Try clonefile
|
135
|
+
if defined?(Clonefile)
|
136
|
+
FileUtils.rm_f(to)
|
137
|
+
begin
|
138
|
+
res = Clonefile.always(from, to)
|
139
|
+
return if res
|
140
|
+
rescue Clonefile::UnsupportedPlatform, Errno::ENOTSUP, Errno::EXDEV, Errno::EINVAL
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Fall back to old-school copy
|
145
|
+
FileUtils.cp(from, to)
|
146
|
+
end
|
126
147
|
end
|
127
148
|
end
|
128
149
|
end
|
@@ -36,12 +36,7 @@ module Nanoc
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def compiled_content_cache_class
|
39
|
-
|
40
|
-
if Nanoc::Core::Feature.enabled?(feature_name)
|
41
|
-
Nanoc::Core::CompiledContentCache
|
42
|
-
else
|
43
|
-
Nanoc::Core::TextualCompiledContentCache
|
44
|
-
end
|
39
|
+
Nanoc::Core::CompiledContentCache
|
45
40
|
end
|
46
41
|
end
|
47
42
|
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'), 3)
|
15
15
|
|
16
16
|
@cache = {}
|
17
17
|
end
|
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.
|
4
|
+
version: 4.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -314,7 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
314
314
|
- !ruby/object:Gem::Version
|
315
315
|
version: '0'
|
316
316
|
requirements: []
|
317
|
-
rubygems_version: 3.2.
|
317
|
+
rubygems_version: 3.2.11
|
318
318
|
signing_key:
|
319
319
|
specification_version: 4
|
320
320
|
summary: Core of Nanoc
|