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
@@ -11,17 +11,17 @@ EOS
|
|
11
11
|
it 'does not reuse old content' do
|
12
12
|
File.write('content/foo.md', 'I am old foo!')
|
13
13
|
File.write('content/bar.md', 'I am old bar!')
|
14
|
-
Nanoc::CLI.run(%w
|
14
|
+
Nanoc::CLI.run(%w[compile])
|
15
15
|
expect(File.read('output/foo.md')).to eql('I am old foo!')
|
16
16
|
expect(File.read('output/bar.md')).to eql('I am old bar!')
|
17
17
|
|
18
18
|
File.write('content/foo.md', 'I am foo!')
|
19
19
|
File.write('content/bar.md', '<%= @items["/foo.*"].compiled_content %><%= raise "boom" %>')
|
20
|
-
expect { Nanoc::CLI.run(%w
|
20
|
+
expect { Nanoc::CLI.run(%w[compile]) }.to raise_error(Nanoc::Int::Errors::CompilationError)
|
21
21
|
expect(File.read('output/foo.md')).to eql('I am foo!')
|
22
22
|
|
23
23
|
File.write('content/bar.md', '[<%= @items["/foo.*"].compiled_content %>]')
|
24
|
-
Nanoc::CLI.run(%w
|
24
|
+
Nanoc::CLI.run(%w[compile])
|
25
25
|
expect(File.read('output/foo.md')).to eql('I am foo!')
|
26
26
|
expect(File.read('output/bar.md')).to eql('[I am foo!]')
|
27
27
|
end
|
@@ -20,15 +20,15 @@ EOS
|
|
20
20
|
|
21
21
|
it 'recompiles when env changes' do
|
22
22
|
ENV['NANOC_ENV'] = nil
|
23
|
-
Nanoc::CLI.run(%w
|
23
|
+
Nanoc::CLI.run(%w[compile])
|
24
24
|
expect(File.read('output/foo.erb')).to eql('build=dev')
|
25
25
|
|
26
26
|
ENV['NANOC_ENV'] = nil
|
27
|
-
Nanoc::CLI.run(%w
|
27
|
+
Nanoc::CLI.run(%w[compile -e prod])
|
28
28
|
expect(File.read('output/foo.erb')).to eql('build=prod')
|
29
29
|
|
30
30
|
ENV['NANOC_ENV'] = nil
|
31
|
-
Nanoc::CLI.run(%w
|
31
|
+
Nanoc::CLI.run(%w[compile])
|
32
32
|
expect(File.read('output/foo.erb')).to eql('build=dev')
|
33
33
|
end
|
34
34
|
end
|
@@ -15,7 +15,7 @@ EOS
|
|
15
15
|
|
16
16
|
it 'raises CannotGetCompiledContentOfBinaryItem twice' do
|
17
17
|
2.times do
|
18
|
-
expect { Nanoc::CLI.run(%w
|
18
|
+
expect { Nanoc::CLI.run(%w[compile]) }
|
19
19
|
.to raise_wrapped_error(an_instance_of(Nanoc::Int::Errors::CannotGetCompiledContentOfBinaryItem))
|
20
20
|
end
|
21
21
|
end
|
@@ -11,16 +11,16 @@ EOS
|
|
11
11
|
end
|
12
12
|
|
13
13
|
before do
|
14
|
-
Nanoc::CLI.run(%w
|
14
|
+
Nanoc::CLI.run(%w[compile])
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'does not output filename more than once' do
|
18
18
|
regex = /skip.*index\.html.*skip.*index\.html/m
|
19
|
-
expect { Nanoc::CLI.run(%w
|
19
|
+
expect { Nanoc::CLI.run(%w[compile --verbose]) }.not_to output(regex).to_stdout
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'outputs filename' do
|
23
23
|
regex = /skip.*index\.html/
|
24
|
-
expect { Nanoc::CLI.run(%w
|
24
|
+
expect { Nanoc::CLI.run(%w[compile --verbose]) }.to output(regex).to_stdout
|
25
25
|
end
|
26
26
|
end
|
@@ -12,7 +12,7 @@ EOS
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'detects missing output file of non-default rep' do
|
15
|
-
Nanoc::CLI.run(%w
|
15
|
+
Nanoc::CLI.run(%w[compile])
|
16
16
|
expect(File.file?('output/first.html')).to be
|
17
17
|
expect(File.file?('output/last.html')).to be
|
18
18
|
|
@@ -20,7 +20,7 @@ EOS
|
|
20
20
|
expect(File.file?('output/first.html')).not_to be
|
21
21
|
expect(File.file?('output/last.html')).to be
|
22
22
|
|
23
|
-
Nanoc::CLI.run(%w
|
23
|
+
Nanoc::CLI.run(%w[compile])
|
24
24
|
expect(File.file?('output/first.html')).to be
|
25
25
|
expect(File.file?('output/last.html')).to be
|
26
26
|
end
|
@@ -17,7 +17,7 @@ EOS
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'does not crash' do
|
20
|
-
expect { Nanoc::CLI.run(%w
|
20
|
+
expect { Nanoc::CLI.run(%w[check donkey]) }.to(
|
21
21
|
raise_error(Nanoc::Int::Errors::GenericTrivial, 'One or more checks failed').and(
|
22
22
|
output(/Issues found!\n \(global\):\n \[ (\e\[31m)?ERROR(\e\[0m)? \] donkey - Not enough donkeys\n \/catlady.md:\n \[ (\e\[31m)?ERROR(\e\[0m)? \] donkey - Too many cats\n/).to_stdout,
|
23
23
|
),
|
@@ -18,12 +18,12 @@ EOS
|
|
18
18
|
end
|
19
19
|
|
20
20
|
example do
|
21
|
-
Nanoc::CLI.run(%w
|
21
|
+
Nanoc::CLI.run(%w[compile])
|
22
22
|
|
23
23
|
File.write('content/bar.md', 'I am bar! Modified!')
|
24
|
-
expect { Nanoc::CLI.run(%w
|
24
|
+
expect { Nanoc::CLI.run(%w[compile]) }.to output(%r{^Modified: /bar.md - default$}).to_stdout
|
25
25
|
|
26
26
|
File.write('content/bar.md', 'I am bar! Modified again!')
|
27
|
-
expect { Nanoc::CLI.run(%w
|
27
|
+
expect { Nanoc::CLI.run(%w[compile]) }.not_to output(%r{^Modified: /foo.md - default$}).to_stdout
|
28
28
|
end
|
29
29
|
end
|
@@ -18,11 +18,11 @@ EOS
|
|
18
18
|
end
|
19
19
|
|
20
20
|
example do
|
21
|
-
Nanoc::CLI.run(%w
|
21
|
+
Nanoc::CLI.run(%w[compile])
|
22
22
|
before = File.read('output/index.html')
|
23
23
|
|
24
24
|
sleep(0.1)
|
25
|
-
Nanoc::CLI.run(%w
|
25
|
+
Nanoc::CLI.run(%w[compile])
|
26
26
|
after = File.read('output/index.html')
|
27
27
|
expect(after).to eql(before)
|
28
28
|
expect(after).to match(/\Ahi! - \d+/)
|
@@ -16,11 +16,11 @@ EOS
|
|
16
16
|
end
|
17
17
|
|
18
18
|
example do
|
19
|
-
Nanoc::CLI.run(%w
|
19
|
+
Nanoc::CLI.run(%w[compile])
|
20
20
|
expect(File.read('output/hello.html')).to include('giraffes?')
|
21
21
|
|
22
22
|
File.write('layouts/foo.erb', 'donkeys? <%= yield %>')
|
23
|
-
Nanoc::CLI.run(%w
|
23
|
+
Nanoc::CLI.run(%w[compile])
|
24
24
|
expect(File.read('output/hello.html')).to include('donkeys?')
|
25
25
|
end
|
26
26
|
end
|
@@ -56,7 +56,7 @@ EOS
|
|
56
56
|
end
|
57
57
|
|
58
58
|
before do
|
59
|
-
Nanoc::CLI.run(%w
|
59
|
+
Nanoc::CLI.run(%w[compile])
|
60
60
|
end
|
61
61
|
|
62
62
|
example do
|
@@ -81,7 +81,7 @@ EOS
|
|
81
81
|
</xsl:stylesheet>
|
82
82
|
EOS
|
83
83
|
|
84
|
-
expect { Nanoc::CLI.run(%w
|
84
|
+
expect { Nanoc::CLI.run(%w[compile]) }
|
85
85
|
.to change { File.read('output/index.xhtml') }
|
86
86
|
.from(/<title>Original Title/)
|
87
87
|
.to(/<title>Changed Title/)
|
@@ -16,10 +16,10 @@ EOS
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'does not use cache when switching environments' do
|
19
|
-
Nanoc::CLI.run(%w
|
19
|
+
Nanoc::CLI.run(%w[compile])
|
20
20
|
expect(File.read('output/style.css')).to eq(".test { color: red; }\n")
|
21
21
|
|
22
|
-
Nanoc::CLI.run(%w
|
22
|
+
Nanoc::CLI.run(%w[compile --env=staging])
|
23
23
|
expect(File.read('output/style.css')).to eq(".test {\n color: red;\n}\n")
|
24
24
|
end
|
25
25
|
end
|
@@ -15,7 +15,7 @@ EOS
|
|
15
15
|
|
16
16
|
example do
|
17
17
|
File.write('output/foo', 'I am an older foo!')
|
18
|
-
expect { Nanoc::CLI.run(%w
|
18
|
+
expect { Nanoc::CLI.run(%w[compile]) }.to output(%r{\s+update.* output/foo$}).to_stdout
|
19
19
|
expect(File.read('output/foo')).to eq('Foo!')
|
20
20
|
end
|
21
21
|
end
|
@@ -15,13 +15,13 @@ end
|
|
15
15
|
EOS
|
16
16
|
end
|
17
17
|
|
18
|
-
before { Nanoc::CLI.run(%w
|
18
|
+
before { Nanoc::CLI.run(%w[compile]) }
|
19
19
|
|
20
20
|
it 'shows default rep outdatedness' do
|
21
|
-
expect { Nanoc::CLI.run(%w
|
21
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
22
22
|
output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout,
|
23
23
|
)
|
24
|
-
expect { Nanoc::CLI.run(%w
|
24
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
25
25
|
output(/^item \/bar\.md, rep default:\n is not outdated/).to_stdout,
|
26
26
|
)
|
27
27
|
end
|
@@ -29,10 +29,10 @@ EOS
|
|
29
29
|
it 'shows file as outdated after modification' do
|
30
30
|
File.write('content/bar.md', 'JUST BAR!')
|
31
31
|
|
32
|
-
expect { Nanoc::CLI.run(%w
|
32
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
33
33
|
output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout,
|
34
34
|
)
|
35
|
-
expect { Nanoc::CLI.run(%w
|
35
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
36
36
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
37
37
|
)
|
38
38
|
end
|
@@ -40,10 +40,10 @@ EOS
|
|
40
40
|
it 'shows file and dependencies as outdated after modification' do
|
41
41
|
File.write('content/foo.md', 'FOO!')
|
42
42
|
|
43
|
-
expect { Nanoc::CLI.run(%w
|
43
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
44
44
|
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
|
45
45
|
)
|
46
|
-
expect { Nanoc::CLI.run(%w
|
46
|
+
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
|
47
47
|
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
|
48
48
|
)
|
49
49
|
end
|