nanoc-cli 4.11.14 → 4.11.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +1 -1
- data/README.md +1 -1
- data/lib/nanoc/cli/commands/create-site.rb +12 -7
- data/lib/nanoc/cli/commands/prune.rb +6 -0
- data/lib/nanoc/cli/compile_listeners/file_action_printer.rb +4 -0
- data/lib/nanoc/cli/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7504b1b1793c513533932723ac0b841af1a05fdc10be4665e7f7a44046b0c91
|
4
|
+
data.tar.gz: d82848a49519b66814e70b45686dcbd593f67ded95154413533d56004f527112
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6974c2d81a973530aa3d109083bca619adb8a016d372e1dddae1bf721fceb1d61116360782e00e3e94e274d2939d1322816ba71dc04479a6ef8174714dea38fb
|
7
|
+
data.tar.gz: 243a79c2c5c876bd660c01d9e3e262925b0f00581d05093fc833ef54e047bc3835f4fd6cc436d1d6a07cb4b397eb421fbc15579d1a89f520dfad374a98c2cfb9
|
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -35,14 +35,14 @@ module Nanoc::CLI::Commands
|
|
35
35
|
DEFAULT_RULES = <<~EOS unless defined? DEFAULT_RULES
|
36
36
|
#!/usr/bin/env ruby
|
37
37
|
|
38
|
-
compile '/index.html' do
|
39
|
-
layout '/default.*'
|
40
|
-
write '/index.html'
|
41
|
-
end
|
42
|
-
|
43
38
|
compile '/**/*.html' do
|
44
39
|
layout '/default.*'
|
45
|
-
|
40
|
+
|
41
|
+
if item.identifier =~ '**/index.*'
|
42
|
+
write item.identifier.to_s
|
43
|
+
else
|
44
|
+
write item.identifier.without_ext + '/index.html'
|
45
|
+
end
|
46
46
|
end
|
47
47
|
|
48
48
|
# This is an example rule that matches Markdown (.md) files, and filters them
|
@@ -52,7 +52,12 @@ module Nanoc::CLI::Commands
|
|
52
52
|
#compile '/**/*.md' do
|
53
53
|
# filter :kramdown
|
54
54
|
# layout '/default.*'
|
55
|
-
#
|
55
|
+
#
|
56
|
+
# if item.identifier =~ '**/index.*'
|
57
|
+
# write item.identifier.to_s
|
58
|
+
# else
|
59
|
+
# write item.identifier.without_ext + '/index.html'
|
60
|
+
# end
|
56
61
|
#end
|
57
62
|
|
58
63
|
compile '/**/*' do
|
@@ -22,6 +22,10 @@ module Nanoc::CLI::Commands
|
|
22
22
|
res = Nanoc::Core::Compiler.new_for(@site).run_until_reps_built
|
23
23
|
reps = res.fetch(:reps)
|
24
24
|
|
25
|
+
listener_class = Nanoc::CLI::CompileListeners::FileActionPrinter
|
26
|
+
listener = listener_class.new(reps: reps)
|
27
|
+
listener.start_safely
|
28
|
+
|
25
29
|
if options.key?(:yes)
|
26
30
|
Nanoc::Core::Pruner.new(@site.config, reps, exclude: prune_config_exclude).run
|
27
31
|
elsif options.key?(:'dry-run')
|
@@ -32,6 +36,8 @@ module Nanoc::CLI::Commands
|
|
32
36
|
$stderr.puts 'Please ensure that the output directory does not contain any files (such as images or stylesheets) that are necessary but are not managed by Nanoc. If you want to get a list of all files that would be removed, pass --dry-run.'
|
33
37
|
exit 1
|
34
38
|
end
|
39
|
+
ensure
|
40
|
+
listener&.stop_safely
|
35
41
|
end
|
36
42
|
|
37
43
|
protected
|
@@ -59,6 +59,10 @@ module Nanoc::CLI::CompileListeners
|
|
59
59
|
on(:file_pruned) do |path|
|
60
60
|
Nanoc::CLI::Logger.instance.file(:high, :delete, path)
|
61
61
|
end
|
62
|
+
|
63
|
+
on(:file_listed_for_pruning) do |path|
|
64
|
+
Nanoc::CLI::Logger.instance.file(:high, :delete, '(dry run) ' + path)
|
65
|
+
end
|
62
66
|
end
|
63
67
|
|
64
68
|
# @see Listener#stop
|
data/lib/nanoc/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.11.
|
4
|
+
version: 4.11.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.11.
|
47
|
+
version: 4.11.15
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.11.
|
54
|
+
version: 4.11.15
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: zeitwerk
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
123
|
+
rubygems_version: 3.1.2
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: CLI for Nanoc
|