nanoc-core 4.12.4 → 4.12.7
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/action_sequence.rb +4 -4
- data/lib/nanoc/core/basic_item_rep_view.rb +1 -1
- data/lib/nanoc/core/binary_compiled_content_cache.rb +8 -1
- data/lib/nanoc/core/changes_stream.rb +4 -4
- data/lib/nanoc/core/compilation_phases/resume.rb +2 -2
- data/lib/nanoc/core/compilation_stages/compile_reps.rb +1 -3
- data/lib/nanoc/core/config_loader.rb +3 -1
- data/lib/nanoc/core/configuration.rb +3 -3
- data/lib/nanoc/core/contracts_support.rb +1 -1
- data/lib/nanoc/core/document.rb +1 -1
- data/lib/nanoc/core/document_view_mixin.rb +1 -1
- data/lib/nanoc/core/identifier.rb +7 -7
- data/lib/nanoc/core/outdatedness_checker.rb +3 -3
- data/lib/nanoc/core/processing_actions/filter.rb +1 -1
- data/lib/nanoc/core/processing_actions/layout.rb +1 -1
- data/lib/nanoc/core/processing_actions/snapshot.rb +1 -1
- data/lib/nanoc/core/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb5a347a2a973a7c42b1f85746b5267b43c588bf627c4f813c09c3a23b8e7eb
|
4
|
+
data.tar.gz: f03ba79aea51348eca0a83c80e3bef8a5853da59981205939b7d417588dd3678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0211852d5d7069d0dec63609db20a2cf533ba167e71ab08e195e333abea2cb17ecce34b05c4c65cd0be84c1726389caae8f02313188641a980e1aa6622f47619'
|
7
|
+
data.tar.gz: d3f7d023ce5855b2e2b67c2e49132b60aaec1f8cc71bf7163b2d1a2492304fccf932a2252e0ea1546c4694a83168395195dae444c530ad641c37d5f45e0a9673
|
@@ -46,16 +46,16 @@ module Nanoc
|
|
46
46
|
end
|
47
47
|
|
48
48
|
# contract C::Func[Nanoc::Core::ProcessingAction => C::Any] => self
|
49
|
-
def each
|
50
|
-
@actions.each
|
49
|
+
def each(&block)
|
50
|
+
@actions.each(&block)
|
51
51
|
self
|
52
52
|
end
|
53
53
|
|
54
54
|
# contract C::Func[Nanoc::Core::ProcessingAction => C::Any] => self
|
55
|
-
def map
|
55
|
+
def map(&block)
|
56
56
|
self.class.new(
|
57
57
|
@item_rep,
|
58
|
-
actions: @actions.map
|
58
|
+
actions: @actions.map(&block),
|
59
59
|
)
|
60
60
|
end
|
61
61
|
end
|
@@ -92,6 +92,10 @@ module Nanoc
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
+
def use_clonefile?
|
96
|
+
defined?(Clonefile)
|
97
|
+
end
|
98
|
+
|
95
99
|
private
|
96
100
|
|
97
101
|
def dirname
|
@@ -132,7 +136,7 @@ module Nanoc
|
|
132
136
|
# changed outside of Nanoc.
|
133
137
|
|
134
138
|
# Try clonefile
|
135
|
-
if
|
139
|
+
if use_clonefile?
|
136
140
|
FileUtils.rm_f(to)
|
137
141
|
begin
|
138
142
|
res = Clonefile.always(from, to)
|
@@ -142,6 +146,9 @@ module Nanoc
|
|
142
146
|
end
|
143
147
|
|
144
148
|
# Fall back to old-school copy
|
149
|
+
if File.file?(to)
|
150
|
+
FileUtils.rm_f(to)
|
151
|
+
end
|
145
152
|
FileUtils.cp(from, to)
|
146
153
|
end
|
147
154
|
end
|
@@ -38,16 +38,16 @@ module Nanoc
|
|
38
38
|
@listener&.to_stop&.call
|
39
39
|
end
|
40
40
|
|
41
|
-
def map
|
42
|
-
self.class.new(enum: @enum.map
|
41
|
+
def map(&block)
|
42
|
+
self.class.new(enum: @enum.map(&block))
|
43
43
|
end
|
44
44
|
|
45
45
|
def to_enum
|
46
46
|
@enum
|
47
47
|
end
|
48
48
|
|
49
|
-
def each
|
50
|
-
@enum.each
|
49
|
+
def each(&block)
|
50
|
+
@enum.each(&block)
|
51
51
|
nil
|
52
52
|
end
|
53
53
|
end
|
@@ -10,8 +10,8 @@ module Nanoc
|
|
10
10
|
DONE = Object.new
|
11
11
|
|
12
12
|
contract Nanoc::Core::ItemRep, C::KeywordArgs[is_outdated: C::Bool], C::Func[C::None => C::Any] => C::Any
|
13
|
-
def run(rep, is_outdated
|
14
|
-
fiber = fiber_for(rep, is_outdated: is_outdated)
|
13
|
+
def run(rep, is_outdated:, &block)
|
14
|
+
fiber = fiber_for(rep, is_outdated: is_outdated, &block)
|
15
15
|
while fiber.alive?
|
16
16
|
res = fiber.resume
|
17
17
|
|
@@ -84,11 +84,9 @@ module Nanoc
|
|
84
84
|
outdatedness_store: @outdatedness_store,
|
85
85
|
)
|
86
86
|
|
87
|
-
|
87
|
+
Nanoc::Core::CompilationPhases::Notify.new(
|
88
88
|
wrapped: mark_done_phase,
|
89
89
|
)
|
90
|
-
|
91
|
-
notify_phrase
|
92
90
|
end
|
93
91
|
end
|
94
92
|
end
|
@@ -4,6 +4,8 @@ module Nanoc
|
|
4
4
|
module Core
|
5
5
|
# @api private
|
6
6
|
class ConfigLoader
|
7
|
+
PERMITTED_YAML_CLASSES = [Symbol, Date, Time].freeze
|
8
|
+
|
7
9
|
class NoConfigFileFoundError < ::Nanoc::Core::Error
|
8
10
|
def initialize
|
9
11
|
super('No configuration file found')
|
@@ -54,7 +56,7 @@ module Nanoc
|
|
54
56
|
end
|
55
57
|
|
56
58
|
def load_file(filename)
|
57
|
-
YAML.
|
59
|
+
YAML.safe_load_file(filename, permitted_classes: PERMITTED_YAML_CLASSES)
|
58
60
|
end
|
59
61
|
|
60
62
|
# @api private
|
@@ -45,7 +45,7 @@ module Nanoc
|
|
45
45
|
NANOC_ENV_DEFAULT = 'default'
|
46
46
|
|
47
47
|
contract C::KeywordArgs[hash: C::Optional[Hash], env_name: C::Maybe[String], dir: C::AbsolutePathString] => C::Any
|
48
|
-
def initialize(hash: {},
|
48
|
+
def initialize(dir:, hash: {}, env_name: nil)
|
49
49
|
@env_name = env_name
|
50
50
|
@wrapped = hash.__nanoc_symbolize_keys_recursively
|
51
51
|
@dir = dir
|
@@ -136,8 +136,8 @@ module Nanoc
|
|
136
136
|
end
|
137
137
|
|
138
138
|
contract C::Func[C::Any, C::Any => C::Any] => self
|
139
|
-
def each
|
140
|
-
@wrapped.each
|
139
|
+
def each(&block)
|
140
|
+
@wrapped.each(&block)
|
141
141
|
self
|
142
142
|
end
|
143
143
|
|
data/lib/nanoc/core/document.rb
CHANGED
@@ -88,7 +88,7 @@ module Nanoc
|
|
88
88
|
|
89
89
|
contract C::None => C::Num
|
90
90
|
def hash
|
91
|
-
self.class
|
91
|
+
[self.class, to_s].hash
|
92
92
|
end
|
93
93
|
|
94
94
|
contract C::Any => C::Maybe[C::Num]
|
@@ -149,10 +149,10 @@ module Nanoc
|
|
149
149
|
|
150
150
|
extname = File.extname(@string)
|
151
151
|
|
152
|
-
if
|
153
|
-
@string[0..-extname.size - 1]
|
154
|
-
else
|
152
|
+
if extname.empty?
|
155
153
|
@string
|
154
|
+
else
|
155
|
+
@string[0..-extname.size - 1]
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
@@ -171,10 +171,10 @@ module Nanoc
|
|
171
171
|
# The identifier, as string, with all extensions removed
|
172
172
|
def without_exts
|
173
173
|
extname = exts.join('.')
|
174
|
-
if
|
175
|
-
@string[0..-extname.size - 2]
|
176
|
-
else
|
174
|
+
if extname.empty?
|
177
175
|
@string
|
176
|
+
else
|
177
|
+
@string[0..-extname.size - 2]
|
178
178
|
end
|
179
179
|
end
|
180
180
|
|
@@ -80,15 +80,15 @@ module Nanoc
|
|
80
80
|
# contract C::ArrayOf[Class], C_OBJ_MAYBE_REP, Nanoc::Core::OutdatednessStatus => C::Maybe[Nanoc::Core::OutdatednessStatus]
|
81
81
|
def apply_rules(rules, obj, status = Nanoc::Core::OutdatednessStatus.new)
|
82
82
|
rules.inject(status) do |acc, rule|
|
83
|
-
if
|
84
|
-
acc
|
85
|
-
else
|
83
|
+
if acc.useful_to_apply?(rule)
|
86
84
|
reason = rule.instance.call(obj, @outdatedness_checker)
|
87
85
|
if reason
|
88
86
|
acc.update(reason)
|
89
87
|
else
|
90
88
|
acc
|
91
89
|
end
|
90
|
+
else
|
91
|
+
acc
|
92
92
|
end
|
93
93
|
end
|
94
94
|
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.12.
|
4
|
+
version: 4.12.7
|
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-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.5'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: psych
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '4.0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '4.0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: slow_enumerator_tools
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -294,14 +308,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
294
308
|
requirements:
|
295
309
|
- - ">="
|
296
310
|
- !ruby/object:Gem::Version
|
297
|
-
version: '2.
|
311
|
+
version: '2.7'
|
298
312
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
299
313
|
requirements:
|
300
314
|
- - ">="
|
301
315
|
- !ruby/object:Gem::Version
|
302
316
|
version: '0'
|
303
317
|
requirements: []
|
304
|
-
rubygems_version: 3.3.
|
318
|
+
rubygems_version: 3.3.15
|
305
319
|
signing_key:
|
306
320
|
specification_version: 4
|
307
321
|
summary: Core of Nanoc
|