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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c4a13b110c501903e5bc6fe6a9a60c217cfab9bb44c65f6fe991f084796924e
4
- data.tar.gz: db194a58e497dc122e0bc7cdf77bf453d0e2cbab7dd138d5937c5ec411058ae4
3
+ metadata.gz: d7504b1b1793c513533932723ac0b841af1a05fdc10be4665e7f7a44046b0c91
4
+ data.tar.gz: d82848a49519b66814e70b45686dcbd593f67ded95154413533d56004f527112
5
5
  SHA512:
6
- metadata.gz: 6b98062498f27a350d6fc67e5b6bfb85d3eb5b1dbb71d26a85dbefd7a1c668cc492a5d038249051e2cf0f6ce7873211f3cf29cc4996f9e396042cf6b73812990
7
- data.tar.gz: 6fe2ae1d66a7fb1136b2bdbeb09105a629a3ee4a662ebbfc63624a47feef9594e36b5b8e62feadd7c328eb233fde5823b48e49a3d4815876da2a2cb60601233a
6
+ metadata.gz: 6974c2d81a973530aa3d109083bca619adb8a016d372e1dddae1bf721fceb1d61116360782e00e3e94e274d2939d1322816ba71dc04479a6ef8174714dea38fb
7
+ data.tar.gz: 243a79c2c5c876bd660c01d9e3e262925b0f00581d05093fc833ef54e047bc3835f4fd6cc436d1d6a07cb4b397eb421fbc15579d1a89f520dfad374a98c2cfb9
data/NEWS.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # nanoc-cli news
2
2
 
3
- TODO
3
+ See the release notes for Nanoc for details.
data/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # nanoc-cli
2
2
 
3
- TODO
3
+ This package contains the command-line interface for [Nanoc](https://nanoc.ws/).
@@ -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
- write item.identifier.without_ext + '/index.html'
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
- # write item.identifier.without_ext + '/index.html'
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module CLI
5
- VERSION = '4.11.14'
5
+ VERSION = '4.11.15'
6
6
  end
7
7
  end
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.14
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: 2019-11-10 00:00:00.000000000 Z
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.14
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.14
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.0.6
123
+ rubygems_version: 3.1.2
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: CLI for Nanoc