nanoc 4.7.5 → 4.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -3
- data/Gemfile.lock +18 -13
- data/NEWS.md +7 -1
- data/Rakefile +2 -2
- data/lib/nanoc/base/entities/action_sequence.rb +3 -12
- data/lib/nanoc/base/entities/configuration.rb +3 -3
- data/lib/nanoc/base/entities/identifiable_collection.rb +2 -4
- data/lib/nanoc/base/memoization.rb +1 -0
- data/lib/nanoc/base/repos/config_loader.rb +1 -1
- data/lib/nanoc/base/services/compilation_context.rb +3 -3
- data/lib/nanoc/base/services/compiler.rb +2 -3
- data/lib/nanoc/base/services/compiler/stages/cleanup.rb +1 -1
- data/lib/nanoc/base/services/filter.rb +4 -12
- data/lib/nanoc/base/services/item_rep_router.rb +3 -3
- data/lib/nanoc/base/services/outdatedness_checker.rb +1 -2
- data/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb +1 -2
- data/lib/nanoc/base/services/outdatedness_rules/code_snippets_modified.rb +1 -2
- data/lib/nanoc/base/services/outdatedness_rules/configuration_modified.rb +1 -2
- data/lib/nanoc/base/services/outdatedness_rules/paths_modified.rb +5 -5
- data/lib/nanoc/base/services/outdatedness_rules/rules_modified.rb +3 -3
- data/lib/nanoc/base/services/outdatedness_rules/uses_always_outdated_filter.rb +4 -4
- data/lib/nanoc/checking/checks/external_links.rb +0 -2
- data/lib/nanoc/cli.rb +1 -1
- data/lib/nanoc/cli/commands/compile_listeners/timing_recorder.rb +7 -5
- data/lib/nanoc/cli/commands/create-site.rb +1 -1
- data/lib/nanoc/cli/commands/nanoc.rb +1 -4
- data/lib/nanoc/cli/commands/show-plugins.rb +1 -1
- data/lib/nanoc/cli/error_handler.rb +2 -1
- data/lib/nanoc/deploying/deployers/git.rb +7 -7
- data/lib/nanoc/extra/link_collector.rb +2 -2
- data/lib/nanoc/filters/asciidoc.rb +1 -1
- data/lib/nanoc/filters/colorize_syntax.rb +46 -19
- data/lib/nanoc/filters/relativize_paths.rb +33 -9
- data/lib/nanoc/rule_dsl/action_sequence_calculator.rb +15 -7
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.gemspec +1 -1
- data/spec/nanoc/base/checksummer_spec.rb +2 -2
- data/spec/nanoc/base/entities/action_sequence_spec.rb +0 -36
- data/spec/nanoc/base/entities/identifier_spec.rb +1 -1
- data/spec/nanoc/base/entities/outdatedness_status_spec.rb +1 -1
- data/spec/nanoc/base/entities/processing_actions/snapshot_spec.rb +1 -1
- data/spec/nanoc/base/entities/props_spec.rb +13 -13
- data/spec/nanoc/base/memoization_spec.rb +31 -0
- data/spec/nanoc/base/services/executor_spec.rb +2 -2
- data/spec/nanoc/base/services/item_rep_selector_spec.rb +12 -12
- data/spec/nanoc/base/services/outdatedness_checker_spec.rb +23 -23
- data/spec/nanoc/base/views/post_compile_item_view_spec.rb +1 -1
- data/spec/nanoc/cli/commands/deploy_spec.rb +8 -8
- data/spec/nanoc/filters/less_spec.rb +11 -11
- data/spec/nanoc/helpers/capturing_spec.rb +2 -2
- data/spec/nanoc/helpers/tagging_spec.rb +5 -5
- data/spec/nanoc/integration/outdatedness_integration_spec.rb +29 -29
- data/spec/nanoc/integration/partial_recompilation_spec.rb +8 -8
- data/spec/nanoc/regressions/gh_1015_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1022_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1031_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1035_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1037a_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_1037b_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1040_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1045_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1047_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1064_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1067_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1082a_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1082b_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1082c_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1082d_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1093_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1094_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1097_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1100_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1102_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1107_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1130_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1134_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_1145_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_804_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_809_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_841_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_867_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_882_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_885_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_891_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_913_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_924_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_928_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_937_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_942_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_947_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_948_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_951_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_954_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_970a_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_970b_spec.rb +7 -7
- data/spec/nanoc/regressions/gh_974_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_981_spec.rb +3 -3
- data/spec/nanoc/rule_dsl/action_sequence_calculator_spec.rb +43 -4
- data/test/base/core_ext/array_spec.rb +2 -2
- data/test/base/test_compiler.rb +6 -6
- data/test/base/test_filter.rb +0 -8
- data/test/base/test_site.rb +1 -1
- data/test/checking/test_runner.rb +2 -2
- data/test/cli/commands/test_check.rb +2 -2
- data/test/cli/commands/test_compile.rb +6 -6
- data/test/cli/commands/test_create_site.rb +12 -12
- data/test/cli/commands/test_help.rb +2 -2
- data/test/cli/commands/test_info.rb +1 -1
- data/test/cli/commands/test_prune.rb +6 -6
- data/test/cli/test_cleaning_stream.rb +1 -1
- data/test/cli/test_cli.rb +9 -9
- data/test/data_sources/test_filesystem.rb +8 -8
- data/test/extra/core_ext/test_pathname.rb +1 -1
- data/test/extra/test_link_collector.rb +3 -3
- data/test/extra/test_piper.rb +3 -3
- data/test/filters/colorize_syntax/test_common.rb +25 -1
- data/test/filters/test_relativize_paths.rb +38 -0
- data/test/helper.rb +1 -1
- data/test/helpers/test_capturing.rb +8 -8
- data/test/rule_dsl/test_action_provider.rb +2 -2
- data/test/rule_dsl/test_rule.rb +1 -1
- data/test/test_gem.rb +1 -1
- metadata +4 -4
@@ -129,42 +129,6 @@ describe Nanoc::Int::ActionSequence do
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
describe '#compact_snapshots' do
|
133
|
-
subject { action_sequence.compact_snapshots }
|
134
|
-
|
135
|
-
before do
|
136
|
-
action_sequence.add_snapshot(:a1, nil)
|
137
|
-
action_sequence.add_snapshot(:a2, '/a2.md')
|
138
|
-
action_sequence.add_snapshot(:a3, nil)
|
139
|
-
action_sequence.add_filter(:erb, awesomeness: 'high')
|
140
|
-
action_sequence.add_snapshot(:b1, '/b1.md')
|
141
|
-
action_sequence.add_snapshot(:b2, nil)
|
142
|
-
action_sequence.add_snapshot(:b3, '/b3.md')
|
143
|
-
action_sequence.add_filter(:erb, awesomeness: 'high')
|
144
|
-
action_sequence.add_snapshot(:c, nil)
|
145
|
-
end
|
146
|
-
|
147
|
-
example do
|
148
|
-
expect(subject[0]).to be_a(Nanoc::Int::ProcessingActions::Snapshot)
|
149
|
-
expect(subject[0].snapshot_names).to eql(%i(a1 a2 a3))
|
150
|
-
expect(subject[0].paths).to eql(['/a2.md'])
|
151
|
-
|
152
|
-
expect(subject[1]).to be_a(Nanoc::Int::ProcessingActions::Filter)
|
153
|
-
|
154
|
-
expect(subject[2]).to be_a(Nanoc::Int::ProcessingActions::Snapshot)
|
155
|
-
expect(subject[2].snapshot_names).to eql(%i(b1 b2 b3))
|
156
|
-
expect(subject[2].paths).to eql(['/b1.md', '/b3.md'])
|
157
|
-
|
158
|
-
expect(subject[3]).to be_a(Nanoc::Int::ProcessingActions::Filter)
|
159
|
-
|
160
|
-
expect(subject[4]).to be_a(Nanoc::Int::ProcessingActions::Snapshot)
|
161
|
-
expect(subject[4].snapshot_names).to eql([:c])
|
162
|
-
expect(subject[4].paths).to be_empty
|
163
|
-
|
164
|
-
expect(subject.size).to eql(5)
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
132
|
describe '#snapshots_defs' do
|
169
133
|
subject { action_sequence.snapshots_defs }
|
170
134
|
|
@@ -407,7 +407,7 @@ describe Nanoc::Identifier do
|
|
407
407
|
context 'identifier with multiple extensions' do
|
408
408
|
let(:identifier) { described_class.new('/foo.html.md') }
|
409
409
|
|
410
|
-
it { is_expected.to eql(%w
|
410
|
+
it { is_expected.to eql(%w[html md]) }
|
411
411
|
end
|
412
412
|
end
|
413
413
|
|
@@ -106,7 +106,7 @@ describe Nanoc::Int::OutdatednessStatus do
|
|
106
106
|
let(:status) { described_class.new(props: Nanoc::Int::Props.new(attributes: true)) }
|
107
107
|
|
108
108
|
it 'updates props' do
|
109
|
-
expect(subject.props.active).to eql(Set.new(%i
|
109
|
+
expect(subject.props.active).to eql(Set.new(%i[raw_content attributes compiled_content]))
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|
@@ -25,7 +25,7 @@ describe Nanoc::Int::ProcessingActions::Snapshot do
|
|
25
25
|
|
26
26
|
context 'with snapshot name' do
|
27
27
|
subject { action.update(snapshot_names: [:zebra]) }
|
28
|
-
its(:snapshot_names) { is_expected.to eql(%i
|
28
|
+
its(:snapshot_names) { is_expected.to eql(%i[before_layout zebra]) }
|
29
29
|
its(:paths) { is_expected.to eql(['/foo.md']) }
|
30
30
|
end
|
31
31
|
|
@@ -99,7 +99,7 @@ describe Nanoc::Int::Props do
|
|
99
99
|
let(:props) { described_class.new }
|
100
100
|
let(:other_props) { props_all }
|
101
101
|
|
102
|
-
it { is_expected.to eql(Set.new(%i
|
102
|
+
it { is_expected.to eql(Set.new(%i[raw_content attributes compiled_content path])) }
|
103
103
|
end
|
104
104
|
|
105
105
|
context 'some + nothing' do
|
@@ -113,35 +113,35 @@ describe Nanoc::Int::Props do
|
|
113
113
|
let(:props) { described_class.new(compiled_content: true) }
|
114
114
|
let(:other_props) { described_class.new(raw_content: true) }
|
115
115
|
|
116
|
-
it { is_expected.to eql(Set.new(%i
|
116
|
+
it { is_expected.to eql(Set.new(%i[raw_content compiled_content])) }
|
117
117
|
end
|
118
118
|
|
119
119
|
context 'some + all' do
|
120
120
|
let(:props) { described_class.new(compiled_content: true) }
|
121
121
|
let(:other_props) { props_all }
|
122
122
|
|
123
|
-
it { is_expected.to eql(Set.new(%i
|
123
|
+
it { is_expected.to eql(Set.new(%i[raw_content attributes compiled_content path])) }
|
124
124
|
end
|
125
125
|
|
126
126
|
context 'all + nothing' do
|
127
127
|
let(:props) { props_all }
|
128
128
|
let(:other_props) { described_class.new }
|
129
129
|
|
130
|
-
it { is_expected.to eql(Set.new(%i
|
130
|
+
it { is_expected.to eql(Set.new(%i[raw_content attributes compiled_content path])) }
|
131
131
|
end
|
132
132
|
|
133
133
|
context 'some + all' do
|
134
134
|
let(:props) { props_all }
|
135
135
|
let(:other_props) { described_class.new(compiled_content: true) }
|
136
136
|
|
137
|
-
it { is_expected.to eql(Set.new(%i
|
137
|
+
it { is_expected.to eql(Set.new(%i[raw_content attributes compiled_content path])) }
|
138
138
|
end
|
139
139
|
|
140
140
|
context 'all + all' do
|
141
141
|
let(:props) { props_all }
|
142
142
|
let(:other_props) { props_all }
|
143
143
|
|
144
|
-
it { is_expected.to eql(Set.new(%i
|
144
|
+
it { is_expected.to eql(Set.new(%i[raw_content attributes compiled_content path])) }
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
@@ -155,11 +155,11 @@ describe Nanoc::Int::Props do
|
|
155
155
|
end
|
156
156
|
|
157
157
|
let(:props_attrs_list_a) do
|
158
|
-
described_class.new(attributes: %i
|
158
|
+
described_class.new(attributes: %i[donkey giraffe])
|
159
159
|
end
|
160
160
|
|
161
161
|
let(:props_attrs_list_b) do
|
162
|
-
described_class.new(attributes: %i
|
162
|
+
described_class.new(attributes: %i[giraffe zebra])
|
163
163
|
end
|
164
164
|
|
165
165
|
subject { props.merge(other_props).attributes }
|
@@ -183,7 +183,7 @@ describe Nanoc::Int::Props do
|
|
183
183
|
let(:other_props) { props_attrs_list_a }
|
184
184
|
|
185
185
|
it { is_expected.to be_a(Set) }
|
186
|
-
it { is_expected.to match_array(%i
|
186
|
+
it { is_expected.to match_array(%i[donkey giraffe]) }
|
187
187
|
end
|
188
188
|
|
189
189
|
context 'true + false' do
|
@@ -212,7 +212,7 @@ describe Nanoc::Int::Props do
|
|
212
212
|
let(:other_props) { props_attrs_false }
|
213
213
|
|
214
214
|
it { is_expected.to be_a(Set) }
|
215
|
-
it { is_expected.to match_array(%i
|
215
|
+
it { is_expected.to match_array(%i[donkey giraffe]) }
|
216
216
|
end
|
217
217
|
|
218
218
|
context 'list + true' do
|
@@ -227,7 +227,7 @@ describe Nanoc::Int::Props do
|
|
227
227
|
let(:other_props) { props_attrs_list_b }
|
228
228
|
|
229
229
|
it { is_expected.to be_a(Set) }
|
230
|
-
it { is_expected.to match_array(%i
|
230
|
+
it { is_expected.to match_array(%i[donkey giraffe zebra]) }
|
231
231
|
end
|
232
232
|
end
|
233
233
|
|
@@ -261,12 +261,12 @@ describe Nanoc::Int::Props do
|
|
261
261
|
|
262
262
|
context 'attributes and compiled_content active' do
|
263
263
|
let(:props) { described_class.new(attributes: true, compiled_content: true) }
|
264
|
-
it { is_expected.to eql(Set.new(%i
|
264
|
+
it { is_expected.to eql(Set.new(%i[attributes compiled_content])) }
|
265
265
|
end
|
266
266
|
|
267
267
|
context 'all active' do
|
268
268
|
let(:props) { described_class.new(raw_content: true, attributes: true, compiled_content: true, path: true) }
|
269
|
-
it { is_expected.to eql(Set.new(%i
|
269
|
+
it { is_expected.to eql(Set.new(%i[raw_content attributes compiled_content path])) }
|
270
270
|
end
|
271
271
|
end
|
272
272
|
|
@@ -34,6 +34,28 @@ describe Nanoc::Int::Memoization do
|
|
34
34
|
memoize :run
|
35
35
|
end
|
36
36
|
|
37
|
+
class MemoizationSpecUpcaserInlineSyntax
|
38
|
+
extend Nanoc::Int::Memoization
|
39
|
+
|
40
|
+
memoized def run(value)
|
41
|
+
value.upcase
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class MemoizationSpecInlineSyntaxReturn
|
46
|
+
extend Nanoc::Int::Memoization
|
47
|
+
|
48
|
+
class << self
|
49
|
+
attr_reader :sym
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.record(sym)
|
53
|
+
@sym = sym
|
54
|
+
end
|
55
|
+
|
56
|
+
record memoized def run; end
|
57
|
+
end
|
58
|
+
|
37
59
|
example do
|
38
60
|
sample1a = MemoizationSpecSample1.new(10)
|
39
61
|
sample1b = MemoizationSpecSample1.new(15)
|
@@ -54,6 +76,11 @@ describe Nanoc::Int::Memoization do
|
|
54
76
|
sample.run(5)
|
55
77
|
end
|
56
78
|
|
79
|
+
it 'supports memoized def … syntax' do
|
80
|
+
upcaser = MemoizationSpecUpcaserInlineSyntax.new
|
81
|
+
expect(upcaser.run('hi')).to eq('HI')
|
82
|
+
end
|
83
|
+
|
57
84
|
it 'does not crash on #inspect' do
|
58
85
|
upcaser = MemoizationSpecUpcaser.new
|
59
86
|
10_000.times do |i|
|
@@ -66,6 +93,10 @@ describe Nanoc::Int::Memoization do
|
|
66
93
|
upcaser.inspect
|
67
94
|
end
|
68
95
|
|
96
|
+
it 'returns method name' do
|
97
|
+
expect(MemoizationSpecInlineSyntaxReturn.sym).to eq(:run)
|
98
|
+
end
|
99
|
+
|
69
100
|
it 'sends notifications' do
|
70
101
|
sample = MemoizationSpecSample1.new(10)
|
71
102
|
expect { sample.run(5) }.to send_notification(:memoization_miss, 'MemoizationSpecSample1#run')
|
@@ -408,8 +408,8 @@ describe Nanoc::Int::Executor do
|
|
408
408
|
end
|
409
409
|
|
410
410
|
let(:action_sequence) do
|
411
|
-
Nanoc::Int::ActionSequence.new(rep).tap do |
|
412
|
-
|
411
|
+
Nanoc::Int::ActionSequence.new(rep).tap do |seq|
|
412
|
+
seq.add_filter(:erb, {})
|
413
413
|
end
|
414
414
|
end
|
415
415
|
|
@@ -122,8 +122,8 @@ describe Nanoc::Int::ItemRepSelector do
|
|
122
122
|
end
|
123
123
|
|
124
124
|
example do
|
125
|
-
expect(successfully_yielded).to eq %i
|
126
|
-
expect(tentatively_yielded).to eq %i
|
125
|
+
expect(successfully_yielded).to eq %i[e d c b a]
|
126
|
+
expect(tentatively_yielded).to eq %i[a b c d e d c b a]
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
@@ -133,21 +133,21 @@ describe Nanoc::Int::ItemRepSelector do
|
|
133
133
|
end
|
134
134
|
|
135
135
|
example do
|
136
|
-
expect(successfully_yielded).to eq %i
|
137
|
-
expect(tentatively_yielded).to eq %i
|
136
|
+
expect(successfully_yielded).to eq %i[a b c d e]
|
137
|
+
expect(tentatively_yielded).to eq %i[a b c d e]
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
141
141
|
context 'star dependencies' do
|
142
142
|
let(:dependencies) do
|
143
143
|
{
|
144
|
-
a: %i
|
144
|
+
a: %i[b c d e],
|
145
145
|
}
|
146
146
|
end
|
147
147
|
|
148
148
|
example do
|
149
|
-
expect(successfully_yielded).to eq %i
|
150
|
-
expect(tentatively_yielded).to eq %i
|
149
|
+
expect(successfully_yielded).to eq %i[b c d e a]
|
150
|
+
expect(tentatively_yielded).to eq %i[a b a c a d a e a]
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
@@ -156,13 +156,13 @@ describe Nanoc::Int::ItemRepSelector do
|
|
156
156
|
|
157
157
|
let(:dependencies) do
|
158
158
|
{
|
159
|
-
a: %i
|
159
|
+
a: %i[b c d e],
|
160
160
|
}
|
161
161
|
end
|
162
162
|
|
163
163
|
example do
|
164
|
-
expect(successfully_yielded).to eq %i
|
165
|
-
expect(tentatively_yielded).to eq %i
|
164
|
+
expect(successfully_yielded).to eq %i[b c d e a]
|
165
|
+
expect(tentatively_yielded).to eq %i[a b a c a d a e a]
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
@@ -176,8 +176,8 @@ describe Nanoc::Int::ItemRepSelector do
|
|
176
176
|
end
|
177
177
|
|
178
178
|
it 'picks prioritised roots' do
|
179
|
-
expect(successfully_yielded).to eq %i
|
180
|
-
expect(tentatively_yielded).to eq %i
|
179
|
+
expect(successfully_yielded).to eq %i[d a e b c]
|
180
|
+
expect(tentatively_yielded).to eq %i[a d a b e b c]
|
181
181
|
end
|
182
182
|
end
|
183
183
|
end
|
@@ -31,8 +31,8 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
let(:old_action_sequence_for_item_rep) do
|
34
|
-
Nanoc::Int::ActionSequence.new(item_rep).tap do |
|
35
|
-
|
34
|
+
Nanoc::Int::ActionSequence.new(item_rep).tap do |seq|
|
35
|
+
seq.add_filter(:erb, {})
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -75,8 +75,8 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
75
75
|
|
76
76
|
context 'action sequence differs' do
|
77
77
|
let(:new_action_sequence_for_item_rep) do
|
78
|
-
Nanoc::Int::ActionSequence.new(item_rep).tap do |
|
79
|
-
|
78
|
+
Nanoc::Int::ActionSequence.new(item_rep).tap do |seq|
|
79
|
+
seq.add_filter(:super_erb, {})
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -93,8 +93,8 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
93
93
|
|
94
94
|
context 'action sequence differs' do
|
95
95
|
let(:new_action_sequence_for_item_rep) do
|
96
|
-
Nanoc::Int::ActionSequence.new(item_rep).tap do |
|
97
|
-
|
96
|
+
Nanoc::Int::ActionSequence.new(item_rep).tap do |seq|
|
97
|
+
seq.add_filter(:super_erb, {})
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -124,8 +124,8 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
124
124
|
let(:objects) { [item, other_item] }
|
125
125
|
|
126
126
|
let(:old_action_sequence_for_other_item_rep) do
|
127
|
-
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |
|
128
|
-
|
127
|
+
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |seq|
|
128
|
+
seq.add_filter(:erb, {})
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
@@ -253,9 +253,9 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
253
253
|
|
254
254
|
context 'path changed' do
|
255
255
|
let(:new_action_sequence_for_other_item_rep) do
|
256
|
-
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |
|
257
|
-
|
258
|
-
|
256
|
+
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |seq|
|
257
|
+
seq.add_filter(:erb, {})
|
258
|
+
seq.add_snapshot(:donkey, '/giraffe.txt')
|
259
259
|
end
|
260
260
|
end
|
261
261
|
|
@@ -297,9 +297,9 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
297
297
|
|
298
298
|
context 'path changed' do
|
299
299
|
let(:new_action_sequence_for_other_item_rep) do
|
300
|
-
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |
|
301
|
-
|
302
|
-
|
300
|
+
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |seq|
|
301
|
+
seq.add_filter(:erb, {})
|
302
|
+
seq.add_snapshot(:donkey, '/giraffe.txt')
|
303
303
|
end
|
304
304
|
end
|
305
305
|
|
@@ -330,9 +330,9 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
330
330
|
|
331
331
|
context 'path changed' do
|
332
332
|
let(:new_action_sequence_for_other_item_rep) do
|
333
|
-
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |
|
334
|
-
|
335
|
-
|
333
|
+
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |seq|
|
334
|
+
seq.add_filter(:erb, {})
|
335
|
+
seq.add_snapshot(:donkey, '/giraffe.txt')
|
336
336
|
end
|
337
337
|
end
|
338
338
|
|
@@ -357,9 +357,9 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
357
357
|
|
358
358
|
context 'path changed' do
|
359
359
|
let(:new_action_sequence_for_other_item_rep) do
|
360
|
-
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |
|
361
|
-
|
362
|
-
|
360
|
+
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |seq|
|
361
|
+
seq.add_filter(:erb, {})
|
362
|
+
seq.add_snapshot(:donkey, '/giraffe.txt')
|
363
363
|
end
|
364
364
|
end
|
365
365
|
|
@@ -390,9 +390,9 @@ describe Nanoc::Int::OutdatednessChecker do
|
|
390
390
|
|
391
391
|
context 'rules changed' do
|
392
392
|
let(:new_action_sequence_for_other_item_rep) do
|
393
|
-
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |
|
394
|
-
|
395
|
-
|
393
|
+
Nanoc::Int::ActionSequence.new(other_item_rep).tap do |seq|
|
394
|
+
seq.add_filter(:erb, {})
|
395
|
+
seq.add_filter(:donkey, {})
|
396
396
|
end
|
397
397
|
end
|
398
398
|
|
@@ -16,7 +16,7 @@ describe Nanoc::PostCompileItemView do
|
|
16
16
|
shared_examples 'a method that returns modified reps only' do
|
17
17
|
it 'returns only modified items' do
|
18
18
|
expect(subject.size).to eq(1)
|
19
|
-
expect(subject.map(&:name)).to eq(%i
|
19
|
+
expect(subject.map(&:name)).to eq(%i[modded])
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'returns an array' do
|
@@ -82,12 +82,12 @@ describe Nanoc::CLI::Commands::Deploy, site: true, stdio: true do
|
|
82
82
|
end
|
83
83
|
|
84
84
|
context '--list-deployers' do
|
85
|
-
let(:command) { %w
|
85
|
+
let(:command) { %w[deploy --list-deployers] }
|
86
86
|
include_examples 'lists all deployers'
|
87
87
|
end
|
88
88
|
|
89
89
|
context '-D' do
|
90
|
-
let(:command) { %w
|
90
|
+
let(:command) { %w[deploy -D] }
|
91
91
|
include_examples 'lists all deployers'
|
92
92
|
end
|
93
93
|
end
|
@@ -131,19 +131,19 @@ describe Nanoc::CLI::Commands::Deploy, site: true, stdio: true do
|
|
131
131
|
end
|
132
132
|
|
133
133
|
context '--list' do
|
134
|
-
let(:command) { %w
|
134
|
+
let(:command) { %w[deploy --list] }
|
135
135
|
include_examples 'lists all deployment configurations'
|
136
136
|
end
|
137
137
|
|
138
138
|
context '-L' do
|
139
|
-
let(:command) { %w
|
139
|
+
let(:command) { %w[deploy -L] }
|
140
140
|
include_examples 'lists all deployment configurations'
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
144
|
describe 'deploying' do
|
145
145
|
let(:run) { Nanoc::CLI.run(command) }
|
146
|
-
let(:command) { %w
|
146
|
+
let(:command) { %w[deploy] }
|
147
147
|
|
148
148
|
before do
|
149
149
|
FileUtils.mkdir_p('output')
|
@@ -302,17 +302,17 @@ describe Nanoc::CLI::Commands::Deploy, site: true, stdio: true do
|
|
302
302
|
end
|
303
303
|
|
304
304
|
context 'non-default target, specified as argument' do
|
305
|
-
let(:command) { %w
|
305
|
+
let(:command) { %w[deploy production] }
|
306
306
|
include_examples 'deploy with non-default target'
|
307
307
|
end
|
308
308
|
|
309
309
|
context 'non-default target, specified as option (--target)' do
|
310
|
-
let(:command) { %w
|
310
|
+
let(:command) { %w[deploy --target production] }
|
311
311
|
include_examples 'deploy with non-default target'
|
312
312
|
end
|
313
313
|
|
314
314
|
context 'multiple targets specified' do
|
315
|
-
let(:command) { %w
|
315
|
+
let(:command) { %w[deploy --target staging production] }
|
316
316
|
|
317
317
|
it 'errors' do
|
318
318
|
expect { run }.to raise_error(
|