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
@@ -19,7 +19,7 @@ describe Nanoc::Filters::Less, site: true, stdio: true, v8: true do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'compiles a.less' do
|
22
|
-
Nanoc::CLI.run(%w
|
22
|
+
Nanoc::CLI.run(%w[compile])
|
23
23
|
expect(File.read('output/a.css')).to match(/^p\s*\{\s*color:\s*red;?\s*\}/)
|
24
24
|
end
|
25
25
|
|
@@ -36,7 +36,7 @@ describe Nanoc::Filters::Less, site: true, stdio: true, v8: true do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'compiles and compresses a.less' do
|
39
|
-
Nanoc::CLI.run(%w
|
39
|
+
Nanoc::CLI.run(%w[compile])
|
40
40
|
expect(File.read('output/a.css')).to match(/^\.foo\{bar:a\}\n?\.bar\{foo:b\}/)
|
41
41
|
end
|
42
42
|
end
|
@@ -52,16 +52,16 @@ describe Nanoc::Filters::Less, site: true, stdio: true, v8: true do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
it 'compiles a.less' do
|
55
|
-
Nanoc::CLI.run(%w
|
55
|
+
Nanoc::CLI.run(%w[compile])
|
56
56
|
expect(File.read('output/a.css')).to match(/^p\s*\{\s*color:\s*red;?\s*\}/)
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'recompiles a.less if b.less has changed' do
|
60
|
-
Nanoc::CLI.run(%w
|
60
|
+
Nanoc::CLI.run(%w[compile])
|
61
61
|
|
62
62
|
File.write('content/b.less', 'p { color: blue; }')
|
63
63
|
|
64
|
-
Nanoc::CLI.run(%w
|
64
|
+
Nanoc::CLI.run(%w[compile])
|
65
65
|
expect(File.read('output/a.css')).to match(/^p\s*\{\s*color:\s*blue;?\s*\}/)
|
66
66
|
end
|
67
67
|
end
|
@@ -78,16 +78,16 @@ describe Nanoc::Filters::Less, site: true, stdio: true, v8: true do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
it 'compiles a.less' do
|
81
|
-
Nanoc::CLI.run(%w
|
81
|
+
Nanoc::CLI.run(%w[compile])
|
82
82
|
expect(File.read('output/a.css')).to match(/^p\s*\{\s*color:\s*red;?\s*\}/)
|
83
83
|
end
|
84
84
|
|
85
85
|
it 'recompiles a.less if b.less has changed' do
|
86
|
-
Nanoc::CLI.run(%w
|
86
|
+
Nanoc::CLI.run(%w[compile])
|
87
87
|
|
88
88
|
File.write('content/foo/bar/imported_file.less', 'p { color: blue; }')
|
89
89
|
|
90
|
-
Nanoc::CLI.run(%w
|
90
|
+
Nanoc::CLI.run(%w[compile])
|
91
91
|
expect(File.read('output/a.css')).to match(/^p\s*\{\s*color:\s*blue;?\s*\}/)
|
92
92
|
end
|
93
93
|
end
|
@@ -104,16 +104,16 @@ describe Nanoc::Filters::Less, site: true, stdio: true, v8: true do
|
|
104
104
|
end
|
105
105
|
|
106
106
|
it 'compiles a.less' do
|
107
|
-
Nanoc::CLI.run(%w
|
107
|
+
Nanoc::CLI.run(%w[compile])
|
108
108
|
expect(File.read('output/foo/a.css')).to match(/^p\s*\{\s*color:\s*red;?\s*\}/)
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'recompiles a.less if b.less has changed' do
|
112
|
-
Nanoc::CLI.run(%w
|
112
|
+
Nanoc::CLI.run(%w[compile])
|
113
113
|
|
114
114
|
File.write('content/foo/bar/imported_file.less', 'p { color: blue; }')
|
115
115
|
|
116
|
-
Nanoc::CLI.run(%w
|
116
|
+
Nanoc::CLI.run(%w[compile])
|
117
117
|
expect(File.read('output/foo/a.css')).to match(/^p\s*\{\s*color:\s*blue;?\s*\}/)
|
118
118
|
end
|
119
119
|
end
|
@@ -11,7 +11,7 @@ describe Nanoc::Helpers::Capturing, helper: true do
|
|
11
11
|
|
12
12
|
let(:params) { raise 'overwrite me' }
|
13
13
|
|
14
|
-
let(:contents_enumerator) { %w
|
14
|
+
let(:contents_enumerator) { %w[foo bar].to_enum }
|
15
15
|
|
16
16
|
shared_examples 'setting content' do
|
17
17
|
context 'only name given' do
|
@@ -213,7 +213,7 @@ describe Nanoc::Helpers::Capturing, helper: true do
|
|
213
213
|
let(:_erbout) { ['existing content'] }
|
214
214
|
|
215
215
|
shared_examples 'returns properly joined output' do
|
216
|
-
subject { helper.capture { _erbout << %w
|
216
|
+
subject { helper.capture { _erbout << %w[new _ content] } }
|
217
217
|
|
218
218
|
it 'returns the appended content, joined' do
|
219
219
|
expect(subject).to eql('new_content')
|
@@ -32,7 +32,7 @@ describe Nanoc::Helpers::Tagging, helper: true do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
context 'one tag' do
|
35
|
-
let(:item_attributes) { { tags: %w
|
35
|
+
let(:item_attributes) { { tags: %w[donkey] } }
|
36
36
|
|
37
37
|
context 'implicit base_url' do
|
38
38
|
it { is_expected.to eql('donkey') }
|
@@ -50,16 +50,16 @@ describe Nanoc::Helpers::Tagging, helper: true do
|
|
50
50
|
end
|
51
51
|
|
52
52
|
context 'two tags' do
|
53
|
-
let(:item_attributes) { { tags: %w
|
53
|
+
let(:item_attributes) { { tags: %w[donkey giraffe] } }
|
54
54
|
it { is_expected.to eql('donkey, giraffe') }
|
55
55
|
end
|
56
56
|
|
57
57
|
context 'three tags' do
|
58
|
-
let(:item_attributes) { { tags: %w
|
58
|
+
let(:item_attributes) { { tags: %w[donkey giraffe zebra] } }
|
59
59
|
it { is_expected.to eql('donkey, giraffe, zebra') }
|
60
60
|
|
61
61
|
context 'custom separator' do
|
62
|
-
let(:item_attributes) { { tags: %w
|
62
|
+
let(:item_attributes) { { tags: %w[donkey giraffe zebra] } }
|
63
63
|
let(:params) { { separator: ' / ' } }
|
64
64
|
it { is_expected.to eql('donkey / giraffe / zebra') }
|
65
65
|
end
|
@@ -72,7 +72,7 @@ describe Nanoc::Helpers::Tagging, helper: true do
|
|
72
72
|
before do
|
73
73
|
ctx.create_item('item 1', { tags: [:foo] }, '/item1.md')
|
74
74
|
ctx.create_item('item 2', { tags: [:bar] }, '/item2.md')
|
75
|
-
ctx.create_item('item 3', { tags: %i
|
75
|
+
ctx.create_item('item 3', { tags: %i[foo bar] }, '/item3.md')
|
76
76
|
ctx.create_item('item 4', { tags: nil }, '/item4.md')
|
77
77
|
ctx.create_item('item 5', {}, '/item5.md')
|
78
78
|
end
|
@@ -21,13 +21,13 @@ end
|
|
21
21
|
EOS
|
22
22
|
end
|
23
23
|
|
24
|
-
before { Nanoc::CLI.run(%w
|
24
|
+
before { Nanoc::CLI.run(%w[compile]) }
|
25
25
|
|
26
26
|
it 'shows default rep outdatedness' do
|
27
|
-
expect { Nanoc::CLI.run(%w
|
27
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
28
28
|
output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout,
|
29
29
|
)
|
30
|
-
expect { Nanoc::CLI.run(%w
|
30
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
31
31
|
output(/^item \/bar\.md, rep default:\n is not outdated/).to_stdout,
|
32
32
|
)
|
33
33
|
end
|
@@ -36,10 +36,10 @@ EOS
|
|
36
36
|
File.write('content/bar.md', 'JUST BAR!')
|
37
37
|
FileUtils.touch('content/bar.md', mtime: time)
|
38
38
|
|
39
|
-
expect { Nanoc::CLI.run(%w
|
39
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
40
40
|
output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout,
|
41
41
|
)
|
42
|
-
expect { Nanoc::CLI.run(%w
|
42
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
43
43
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
44
44
|
)
|
45
45
|
end
|
@@ -48,10 +48,10 @@ EOS
|
|
48
48
|
File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoooOoooOOoooOooo")
|
49
49
|
FileUtils.touch('content/foo.md', mtime: time)
|
50
50
|
|
51
|
-
expect { Nanoc::CLI.run(%w
|
51
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
52
52
|
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
|
53
53
|
)
|
54
|
-
expect { Nanoc::CLI.run(%w
|
54
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
55
55
|
output(/^item \/bar\.md, rep default:\n is not outdated/).to_stdout,
|
56
56
|
)
|
57
57
|
end
|
@@ -60,10 +60,10 @@ EOS
|
|
60
60
|
File.write('content/foo.md', "---\ntitle: bye\n---\n\nfoo")
|
61
61
|
FileUtils.touch('content/foo.md', mtime: time)
|
62
62
|
|
63
|
-
expect { Nanoc::CLI.run(%w
|
63
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
64
64
|
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
|
65
65
|
)
|
66
|
-
expect { Nanoc::CLI.run(%w
|
66
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
67
67
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
68
68
|
)
|
69
69
|
end
|
@@ -86,13 +86,13 @@ end
|
|
86
86
|
EOS
|
87
87
|
end
|
88
88
|
|
89
|
-
before { Nanoc::CLI.run(%w
|
89
|
+
before { Nanoc::CLI.run(%w[compile]) }
|
90
90
|
|
91
91
|
it 'shows default rep outdatedness' do
|
92
|
-
expect { Nanoc::CLI.run(%w
|
92
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
93
93
|
output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout,
|
94
94
|
)
|
95
|
-
expect { Nanoc::CLI.run(%w
|
95
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
96
96
|
output(/^item \/bar\.md, rep default:\n is not outdated/).to_stdout,
|
97
97
|
)
|
98
98
|
end
|
@@ -100,10 +100,10 @@ EOS
|
|
100
100
|
it 'shows file as outdated after modification' do
|
101
101
|
File.write('content/bar.md', 'JUST BAR!')
|
102
102
|
|
103
|
-
expect { Nanoc::CLI.run(%w
|
103
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
104
104
|
output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout,
|
105
105
|
)
|
106
|
-
expect { Nanoc::CLI.run(%w
|
106
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
107
107
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
108
108
|
)
|
109
109
|
end
|
@@ -111,10 +111,10 @@ EOS
|
|
111
111
|
it 'shows file and dependencies as outdated after content modification' do
|
112
112
|
File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoooOoooOOoooOooo")
|
113
113
|
|
114
|
-
expect { Nanoc::CLI.run(%w
|
114
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
115
115
|
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
|
116
116
|
)
|
117
|
-
expect { Nanoc::CLI.run(%w
|
117
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
118
118
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
119
119
|
)
|
120
120
|
end
|
@@ -122,10 +122,10 @@ EOS
|
|
122
122
|
it 'shows file and dependencies as not outdated after title modification' do
|
123
123
|
File.write('content/foo.md', "---\ntitle: bye\n---\n\nfoo")
|
124
124
|
|
125
|
-
expect { Nanoc::CLI.run(%w
|
125
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
126
126
|
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
|
127
127
|
)
|
128
|
-
expect { Nanoc::CLI.run(%w
|
128
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
129
129
|
output(/^item \/bar\.md, rep default:\n is not outdated/).to_stdout,
|
130
130
|
)
|
131
131
|
end
|
@@ -148,13 +148,13 @@ end
|
|
148
148
|
EOS
|
149
149
|
end
|
150
150
|
|
151
|
-
before { Nanoc::CLI.run(%w
|
151
|
+
before { Nanoc::CLI.run(%w[compile]) }
|
152
152
|
|
153
153
|
it 'shows default rep outdatedness' do
|
154
|
-
expect { Nanoc::CLI.run(%w
|
154
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
155
155
|
output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout,
|
156
156
|
)
|
157
|
-
expect { Nanoc::CLI.run(%w
|
157
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
158
158
|
output(/^item \/bar\.md, rep default:\n is not outdated/).to_stdout,
|
159
159
|
)
|
160
160
|
end
|
@@ -162,10 +162,10 @@ EOS
|
|
162
162
|
it 'shows file as outdated after modification' do
|
163
163
|
File.write('content/bar.md', 'JUST BAR!')
|
164
164
|
|
165
|
-
expect { Nanoc::CLI.run(%w
|
165
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
166
166
|
output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout,
|
167
167
|
)
|
168
|
-
expect { Nanoc::CLI.run(%w
|
168
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
169
169
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
170
170
|
)
|
171
171
|
end
|
@@ -173,10 +173,10 @@ EOS
|
|
173
173
|
it 'shows file and dependencies as outdated after content modification' do
|
174
174
|
File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoooOoooOOoooOooo")
|
175
175
|
|
176
|
-
expect { Nanoc::CLI.run(%w
|
176
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
177
177
|
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
|
178
178
|
)
|
179
|
-
expect { Nanoc::CLI.run(%w
|
179
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
180
180
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
181
181
|
)
|
182
182
|
end
|
@@ -184,10 +184,10 @@ EOS
|
|
184
184
|
it 'shows file and dependencies as outdated after title modification' do
|
185
185
|
File.write('content/foo.md', "---\ntitle: bye\n---\n\nfoo")
|
186
186
|
|
187
|
-
expect { Nanoc::CLI.run(%w
|
187
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
188
188
|
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
|
189
189
|
)
|
190
|
-
expect { Nanoc::CLI.run(%w
|
190
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
191
191
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
192
192
|
)
|
193
193
|
end
|
@@ -205,10 +205,10 @@ compile '/bar.*' do
|
|
205
205
|
end
|
206
206
|
EOS
|
207
207
|
|
208
|
-
expect { Nanoc::CLI.run(%w
|
208
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
209
209
|
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
|
210
210
|
)
|
211
|
-
expect { Nanoc::CLI.run(%w
|
211
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
212
212
|
output(/^item \/bar\.md, rep default:\n is not outdated/).to_stdout,
|
213
213
|
)
|
214
214
|
end
|
@@ -19,17 +19,17 @@ EOS
|
|
19
19
|
expect(File.file?('output/foo.html')).not_to be
|
20
20
|
expect(File.file?('output/bar.html')).not_to be
|
21
21
|
|
22
|
-
expect { Nanoc::CLI.run(%w
|
22
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }
|
23
23
|
.to(output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout)
|
24
|
-
expect { Nanoc::CLI.run(%w
|
24
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }
|
25
25
|
.to(output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout)
|
26
26
|
|
27
|
-
expect { Nanoc::CLI.run(%w
|
27
|
+
expect { Nanoc::CLI.run(%w[compile --verbose]) rescue nil }
|
28
28
|
.to output(/create.*output\/foo\.html/).to_stdout
|
29
29
|
|
30
|
-
expect { Nanoc::CLI.run(%w
|
30
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }
|
31
31
|
.to(output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout)
|
32
|
-
expect { Nanoc::CLI.run(%w
|
32
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }
|
33
33
|
.to(output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout)
|
34
34
|
|
35
35
|
expect(File.file?('output/foo.html')).to be
|
@@ -37,12 +37,12 @@ EOS
|
|
37
37
|
|
38
38
|
File.write('content/bar.md', '<% raise "boom" %>')
|
39
39
|
|
40
|
-
expect { Nanoc::CLI.run(%w
|
40
|
+
expect { Nanoc::CLI.run(%w[compile --verbose --debug]) rescue nil }
|
41
41
|
.to output(/skip.*output\/foo\.html/).to_stdout
|
42
42
|
|
43
|
-
expect { Nanoc::CLI.run(%w
|
43
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }
|
44
44
|
.to(output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout)
|
45
|
-
expect { Nanoc::CLI.run(%w
|
45
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }
|
46
46
|
.to(output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout)
|
47
47
|
end
|
48
48
|
end
|
@@ -11,7 +11,7 @@ EOS
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'errors' do
|
14
|
-
expect { Nanoc::CLI.run(%w
|
14
|
+
expect { Nanoc::CLI.run(%w[compile --verbose]) }.to raise_exception(Nanoc::Int::ItemRepRouter::RouteWithoutSlashError)
|
15
15
|
expect(File.file?('outputfoo.html')).not_to be
|
16
16
|
end
|
17
17
|
end
|
@@ -16,7 +16,7 @@ EOS
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'recompiles all reps of a changed item' do
|
19
|
-
Nanoc::CLI.run(%w
|
19
|
+
Nanoc::CLI.run(%w[compile])
|
20
20
|
|
21
21
|
expect(File.file?('output/ubuntu-16.10-server-amd64.iso.txt')).to be
|
22
22
|
expect(File.read('output/ubuntu-16.10-server-amd64.iso.txt')).to eq('Ubuntu / torrent contents')
|
@@ -20,7 +20,7 @@ EOS
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'recompiles all reps of a changed item' do
|
23
|
-
Nanoc::CLI.run(%w
|
23
|
+
Nanoc::CLI.run(%w[compile])
|
24
24
|
expect(File.file?('output/bar.txt')).to be
|
25
25
|
expect(File.file?('output/foo.txt')).to be
|
26
26
|
expect(File.file?('output/foo_deps.txt')).to be
|
@@ -40,7 +40,7 @@ EOS
|
|
40
40
|
end
|
41
41
|
EOS
|
42
42
|
|
43
|
-
Nanoc::CLI.run(%w
|
43
|
+
Nanoc::CLI.run(%w[compile])
|
44
44
|
expect(File.file?('output/bar.txt')).to be
|
45
45
|
expect(File.file?('output/foo.txt')).to be
|
46
46
|
expect(File.file?('output/foo_deps.txt')).to be
|
@@ -48,7 +48,7 @@ EOS
|
|
48
48
|
|
49
49
|
File.write('content/bar.md', 'I am a newer bar!')
|
50
50
|
|
51
|
-
Nanoc::CLI.run(%w
|
51
|
+
Nanoc::CLI.run(%w[compile])
|
52
52
|
expect(File.read('output/foo_deps.txt')).to eq('[I am a newer bar!]')
|
53
53
|
end
|
54
54
|
end
|
@@ -17,13 +17,13 @@ EOS
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'writes two files' do
|
20
|
-
Nanoc::CLI.run(%w
|
20
|
+
Nanoc::CLI.run(%w[compile])
|
21
21
|
expect(File.read('output/giraffe.txt')).to eql('I am a giraffe!')
|
22
22
|
expect(File.read('output/giraffe.md')).to eql('I am a giraffe!')
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'has the right :last snapshot' do
|
26
|
-
Nanoc::CLI.run(%w
|
26
|
+
Nanoc::CLI.run(%w[compile])
|
27
27
|
expect(File.read('output/donkey.txt')).to eql('[I am a giraffe!]')
|
28
28
|
end
|
29
29
|
end
|
@@ -26,7 +26,7 @@ EOS
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'creates the sitemap' do
|
29
|
-
Nanoc::CLI.run(%w
|
29
|
+
Nanoc::CLI.run(%w[compile])
|
30
30
|
|
31
31
|
expect(File.file?('output/sitemap.xml')).to be
|
32
32
|
contents = File.read('output/sitemap.xml')
|
@@ -35,10 +35,10 @@ EOS
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'updates the sitemap' do
|
38
|
-
Nanoc::CLI.run(%w
|
38
|
+
Nanoc::CLI.run(%w[compile])
|
39
39
|
File.write('content/foo.txt', 'foo 2')
|
40
40
|
FileUtils.touch('content/foo.txt', mtime: Time.parse('2016-04-03 10:00:00Z'))
|
41
|
-
Nanoc::CLI.run(%w
|
41
|
+
Nanoc::CLI.run(%w[compile])
|
42
42
|
|
43
43
|
expect(File.file?('output/sitemap.xml')).to be
|
44
44
|
contents = File.read('output/sitemap.xml')
|