nanoc 4.7.0 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/NEWS.md +12 -1
- data/README.md +1 -1
- data/lib/nanoc/base/entities/directed_graph.rb +16 -0
- data/lib/nanoc/base/entities/identifiable_collection.rb +24 -8
- data/lib/nanoc/base/entities/outdatedness_reasons.rb +5 -0
- data/lib/nanoc/base/errors.rb +11 -6
- data/lib/nanoc/base/memoization.rb +6 -23
- data/lib/nanoc/base/services/compiler/phases/abstract.rb +3 -3
- data/lib/nanoc/base/services/compiler/phases/cache.rb +1 -3
- data/lib/nanoc/base/services/compiler/phases/mark_done.rb +1 -3
- data/lib/nanoc/base/services/compiler/phases/recalculate.rb +1 -3
- data/lib/nanoc/base/services/compiler/phases/resume.rb +1 -3
- data/lib/nanoc/base/services/compiler/phases/write.rb +1 -3
- data/lib/nanoc/base/services/filter.rb +15 -0
- data/lib/nanoc/base/services/item_rep_selector.rb +1 -1
- data/lib/nanoc/base/services/outdatedness_checker.rb +3 -1
- data/lib/nanoc/base/services/outdatedness_rule.rb +7 -0
- data/lib/nanoc/base/services/outdatedness_rules.rb +16 -0
- data/lib/nanoc/cli/commands/compile.rb +12 -411
- data/lib/nanoc/cli/commands/compile_listeners/abstract.rb +30 -0
- data/lib/nanoc/cli/commands/compile_listeners/debug_printer.rb +34 -0
- data/lib/nanoc/cli/commands/compile_listeners/diff_generator.rb +91 -0
- data/lib/nanoc/cli/commands/compile_listeners/file_action_printer.rb +61 -0
- data/lib/nanoc/cli/commands/compile_listeners/stack_prof_profiler.rb +22 -0
- data/lib/nanoc/cli/commands/compile_listeners/timing_recorder.rb +174 -0
- data/lib/nanoc/filters/xsl.rb +2 -0
- data/lib/nanoc/version.rb +1 -1
- data/spec/nanoc/base/directed_graph_spec.rb +54 -0
- data/spec/nanoc/base/errors/dependency_cycle_spec.rb +32 -0
- data/spec/nanoc/base/filter_spec.rb +36 -0
- data/spec/nanoc/base/services/compiler/phases/abstract_spec.rb +23 -11
- data/spec/nanoc/base/services/outdatedness_rules_spec.rb +41 -0
- data/spec/nanoc/cli/commands/compile/file_action_printer_spec.rb +1 -1
- data/spec/nanoc/cli/commands/compile/timing_recorder_spec.rb +124 -54
- data/spec/nanoc/cli/commands/compile_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1040_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_924_spec.rb +89 -0
- data/test/base/test_compiler.rb +1 -1
- data/test/base/test_memoization.rb +6 -0
- data/test/cli/commands/test_compile.rb +2 -2
- metadata +12 -3
@@ -0,0 +1,89 @@
|
|
1
|
+
describe 'GH-924', site: true, stdio: true do
|
2
|
+
before do
|
3
|
+
File.write('nanoc.yaml', <<EOS)
|
4
|
+
text_extensions: [ 'xml', 'xsl' ]
|
5
|
+
EOS
|
6
|
+
|
7
|
+
File.write('content/index.xml', '<root/>')
|
8
|
+
|
9
|
+
File.write('layouts/default.xsl', <<EOS)
|
10
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
11
|
+
<xsl:stylesheet version="1.0"
|
12
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
13
|
+
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
14
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
15
|
+
exclude-result-prefixes="xhtml">
|
16
|
+
<xsl:output encoding="UTF-8"
|
17
|
+
doctype-public="-//W3C//DTD XHTML 1.1//EN"
|
18
|
+
doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
|
19
|
+
indent="yes" />
|
20
|
+
<xsl:strip-space elements="*" />
|
21
|
+
|
22
|
+
<xsl:include href='layouts/snippet.xsl' />
|
23
|
+
|
24
|
+
</xsl:stylesheet>
|
25
|
+
EOS
|
26
|
+
|
27
|
+
File.write('layouts/snippet.xsl', <<EOS)
|
28
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
29
|
+
<xsl:stylesheet version="1.0"
|
30
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
31
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
32
|
+
exclude-result-prefixes="xhtml">
|
33
|
+
|
34
|
+
<xsl:template match="/root">
|
35
|
+
<html>
|
36
|
+
<head>
|
37
|
+
<title>Original Title</title>
|
38
|
+
</head>
|
39
|
+
<body>
|
40
|
+
<p>Test Body</p>
|
41
|
+
</body>
|
42
|
+
</html>
|
43
|
+
</xsl:template>
|
44
|
+
|
45
|
+
</xsl:stylesheet>
|
46
|
+
EOS
|
47
|
+
|
48
|
+
File.write('Rules', <<EOS)
|
49
|
+
compile '/index.xml' do
|
50
|
+
layout '/default.xsl'
|
51
|
+
write '/index.xhtml'
|
52
|
+
end
|
53
|
+
|
54
|
+
layout '/**/*.xsl', :xsl
|
55
|
+
EOS
|
56
|
+
end
|
57
|
+
|
58
|
+
before do
|
59
|
+
Nanoc::CLI.run(%w(compile))
|
60
|
+
end
|
61
|
+
|
62
|
+
example do
|
63
|
+
File.write('layouts/snippet.xsl', <<EOS)
|
64
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
65
|
+
<xsl:stylesheet version="1.0"
|
66
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
67
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
68
|
+
exclude-result-prefixes="xhtml">
|
69
|
+
|
70
|
+
<xsl:template match="/root">
|
71
|
+
<html>
|
72
|
+
<head>
|
73
|
+
<title>Changed Title</title>
|
74
|
+
</head>
|
75
|
+
<body>
|
76
|
+
<p>Test Body</p>
|
77
|
+
</body>
|
78
|
+
</html>
|
79
|
+
</xsl:template>
|
80
|
+
|
81
|
+
</xsl:stylesheet>
|
82
|
+
EOS
|
83
|
+
|
84
|
+
expect { Nanoc::CLI.run(%w(compile)) }
|
85
|
+
.to change { File.read('output/index.xhtml') }
|
86
|
+
.from(/<title>Original Title/)
|
87
|
+
.to(/<title>Changed Title/)
|
88
|
+
end
|
89
|
+
end
|
data/test/base/test_compiler.rb
CHANGED
@@ -114,7 +114,7 @@ class Nanoc::Int::CompilerTest < Nanoc::TestCase
|
|
114
114
|
end
|
115
115
|
|
116
116
|
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
117
|
-
assert_raises Nanoc::Int::Errors::
|
117
|
+
assert_raises Nanoc::Int::Errors::DependencyCycle do
|
118
118
|
site.compile
|
119
119
|
end
|
120
120
|
end
|
@@ -129,7 +129,7 @@ class Nanoc::CLI::Commands::CompileTest < Nanoc::TestCase
|
|
129
129
|
|
130
130
|
def test_setup_and_teardown_listeners
|
131
131
|
with_site do
|
132
|
-
test_listener_class = Class.new(::Nanoc::CLI::Commands::
|
132
|
+
test_listener_class = Class.new(::Nanoc::CLI::Commands::CompileListeners::Abstract) do
|
133
133
|
def start
|
134
134
|
@started = true
|
135
135
|
end
|
@@ -211,7 +211,7 @@ class Nanoc::CLI::Commands::CompileTest < Nanoc::TestCase
|
|
211
211
|
rescue SystemExit
|
212
212
|
end
|
213
213
|
|
214
|
-
listener = Nanoc::CLI::Commands::
|
214
|
+
listener = Nanoc::CLI::Commands::CompileListeners::FileActionPrinter.new(reps: reps)
|
215
215
|
|
216
216
|
def listener.log(level, action, path, duration)
|
217
217
|
@events ||= []
|
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.7.
|
4
|
+
version: 4.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -251,6 +251,12 @@ files:
|
|
251
251
|
- lib/nanoc/cli/command_runner.rb
|
252
252
|
- lib/nanoc/cli/commands/check.rb
|
253
253
|
- lib/nanoc/cli/commands/compile.rb
|
254
|
+
- lib/nanoc/cli/commands/compile_listeners/abstract.rb
|
255
|
+
- lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
|
256
|
+
- lib/nanoc/cli/commands/compile_listeners/diff_generator.rb
|
257
|
+
- lib/nanoc/cli/commands/compile_listeners/file_action_printer.rb
|
258
|
+
- lib/nanoc/cli/commands/compile_listeners/stack_prof_profiler.rb
|
259
|
+
- lib/nanoc/cli/commands/compile_listeners/timing_recorder.rb
|
254
260
|
- lib/nanoc/cli/commands/create-site.rb
|
255
261
|
- lib/nanoc/cli/commands/deploy.rb
|
256
262
|
- lib/nanoc/cli/commands/nanoc.rb
|
@@ -348,6 +354,7 @@ files:
|
|
348
354
|
- spec/contributors_spec.rb
|
349
355
|
- spec/nanoc/base/checksummer_spec.rb
|
350
356
|
- spec/nanoc/base/compiler_spec.rb
|
357
|
+
- spec/nanoc/base/directed_graph_spec.rb
|
351
358
|
- spec/nanoc/base/entities/configuration_spec.rb
|
352
359
|
- spec/nanoc/base/entities/content_spec.rb
|
353
360
|
- spec/nanoc/base/entities/document_spec.rb
|
@@ -366,6 +373,7 @@ files:
|
|
366
373
|
- spec/nanoc/base/entities/props_spec.rb
|
367
374
|
- spec/nanoc/base/entities/rule_memory_spec.rb
|
368
375
|
- spec/nanoc/base/entities/site_spec.rb
|
376
|
+
- spec/nanoc/base/errors/dependency_cycle_spec.rb
|
369
377
|
- spec/nanoc/base/feature_spec.rb
|
370
378
|
- spec/nanoc/base/filter_spec.rb
|
371
379
|
- spec/nanoc/base/item_rep_writer_spec.rb
|
@@ -477,6 +485,7 @@ files:
|
|
477
485
|
- spec/nanoc/regressions/gh_885_spec.rb
|
478
486
|
- spec/nanoc/regressions/gh_891_spec.rb
|
479
487
|
- spec/nanoc/regressions/gh_913_spec.rb
|
488
|
+
- spec/nanoc/regressions/gh_924_spec.rb
|
480
489
|
- spec/nanoc/regressions/gh_928_spec.rb
|
481
490
|
- spec/nanoc/regressions/gh_937_spec.rb
|
482
491
|
- spec/nanoc/regressions/gh_942_spec.rb
|
@@ -616,7 +625,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
616
625
|
version: '0'
|
617
626
|
requirements: []
|
618
627
|
rubyforge_project:
|
619
|
-
rubygems_version: 2.6.
|
628
|
+
rubygems_version: 2.6.11
|
620
629
|
signing_key:
|
621
630
|
specification_version: 4
|
622
631
|
summary: A static-site generator with a focus on flexibility.
|