nanoc 4.10.2 → 4.10.3
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: 29fff0fd45abb2f33fe2ecd8b80531a166163bfea453b2f4633bd7796847624d
|
4
|
+
data.tar.gz: 8795f5b0c4d192c4d02cc3febc198a5af78410d073ba6df41c8ffbe32ad94f54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d208e075e74aa527b9384aa902a98b52d35ee0fc7432fc2ed93c142ebf66dd02ade7ecf169fce4a1ded36c680428afcf36b675d5de158553beb5d3e256850fcc
|
7
|
+
data.tar.gz: 5a8b4e5c7f3c367620fcf568491665d509dc6ccfab035994bb896962bf83403309b6b116d221836babf82afba750b8b944f38c9ef462d7c45a964fa82afd1877
|
data/NEWS.md
CHANGED
@@ -23,7 +23,7 @@ module Nanoc::Int::ProcessingActions
|
|
23
23
|
|
24
24
|
contract C::KeywordArgs[snapshot_names: C::Optional[C::IterOf[Symbol]], paths: C::Optional[C::IterOf[String]]] => self
|
25
25
|
def update(snapshot_names: [], paths: [])
|
26
|
-
self.class.new(@snapshot_names + snapshot_names, @paths + paths)
|
26
|
+
self.class.new(@snapshot_names + snapshot_names.to_a, @paths + paths.to_a)
|
27
27
|
end
|
28
28
|
|
29
29
|
contract C::None => String
|
@@ -12,7 +12,7 @@ module Nanoc
|
|
12
12
|
@any_layouts = false
|
13
13
|
@last_snapshot = false
|
14
14
|
@pre_snapshot = false
|
15
|
-
@
|
15
|
+
@snapshots_for_which_to_skip_routing_rule = Set.new
|
16
16
|
end
|
17
17
|
|
18
18
|
def inspect
|
@@ -40,7 +40,9 @@ module Nanoc
|
|
40
40
|
MaybePathlike = C::Or[nil, Nanoc::UNDEFINED, String, Nanoc::Identifier]
|
41
41
|
contract Symbol, C::KeywordArgs[path: C::Optional[MaybePathlike]] => nil
|
42
42
|
def snapshot(snapshot_name, path: Nanoc::UNDEFINED)
|
43
|
-
|
43
|
+
unless Nanoc::UNDEFINED.equal?(path)
|
44
|
+
@snapshots_for_which_to_skip_routing_rule << snapshot_name
|
45
|
+
end
|
44
46
|
|
45
47
|
path =
|
46
48
|
if Nanoc::UNDEFINED.equal?(path) || path.nil?
|
@@ -69,9 +71,9 @@ module Nanoc
|
|
69
71
|
@any_layouts
|
70
72
|
end
|
71
73
|
|
72
|
-
contract C::None =>
|
73
|
-
def
|
74
|
-
@
|
74
|
+
contract C::None => Set
|
75
|
+
def snapshots_for_which_to_skip_routing_rule
|
76
|
+
@snapshots_for_which_to_skip_routing_rule
|
75
77
|
end
|
76
78
|
|
77
79
|
contract C::None => C::Bool
|
@@ -69,7 +69,11 @@ module Nanoc::RuleDSL
|
|
69
69
|
recorder.snapshot(:last) unless recorder.last_snapshot?
|
70
70
|
recorder.snapshot(:pre) unless recorder.pre_snapshot?
|
71
71
|
|
72
|
-
copy_paths_from_routing_rules(
|
72
|
+
copy_paths_from_routing_rules(
|
73
|
+
compact_snapshots(recorder.action_sequence),
|
74
|
+
recorder.snapshots_for_which_to_skip_routing_rule,
|
75
|
+
rep: rep,
|
76
|
+
)
|
73
77
|
end
|
74
78
|
|
75
79
|
# @param [Nanoc::Int::Layout] layout
|
@@ -99,26 +103,25 @@ module Nanoc::RuleDSL
|
|
99
103
|
Nanoc::Int::ActionSequence.new(seq.item_rep, actions: actions)
|
100
104
|
end
|
101
105
|
|
102
|
-
def copy_paths_from_routing_rules(seq, rep:)
|
106
|
+
def copy_paths_from_routing_rules(seq, snapshots_for_which_to_skip_routing_rule, rep:)
|
107
|
+
# NOTE: This assumes that `seq` is compacted, i.e. there are no two consecutive snapshot actions.
|
108
|
+
|
103
109
|
seq.map do |action|
|
104
|
-
|
105
|
-
|
106
|
-
else
|
107
|
-
action
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
110
|
+
# Only potentially modify snapshot actions
|
111
|
+
next action unless action.is_a?(Nanoc::Int::ProcessingActions::Snapshot)
|
111
112
|
|
112
|
-
|
113
|
-
|
114
|
-
action.snapshot_names
|
115
|
-
basic_path_from_rules_for(rep, snapshot_name)
|
116
|
-
end.compact
|
113
|
+
# If any of the action’s snapshot are explicitly marked as excluded from
|
114
|
+
# getting a path from a routing rule, then ignore routing rules.
|
115
|
+
next action if snapshots_for_which_to_skip_routing_rule.intersect?(Set.new(action.snapshot_names))
|
117
116
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
117
|
+
# If this action already has paths that don’t come from routing rules,
|
118
|
+
# then don’t add more to them.
|
119
|
+
next action unless action.paths.empty?
|
120
|
+
|
121
|
+
# For each snapshot name, find a path from a routing rule. The routing
|
122
|
+
# rule might return nil, so we need #compact.
|
123
|
+
paths = action.snapshot_names.map { |sn| basic_path_from_rules_for(rep, sn) }.compact
|
124
|
+
action.update(snapshot_names: [], paths: paths)
|
122
125
|
end
|
123
126
|
end
|
124
127
|
|
data/lib/nanoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.10.
|
4
|
+
version: 4.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|