nanoc-cli 4.12.7 → 4.12.9

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: 54ce31131dfbd628ae35493fc601ca5436f96e6a144634a14d3d6c67e1a9208a
4
- data.tar.gz: 7e280e823981a6ed4b4c21a5efd109be05dcd2add68da30adbee6578bdd7bf88
3
+ metadata.gz: 5d8a8f6896a3271b909b3dc379dedfd047887d018439768e72211a34d3aa98d3
4
+ data.tar.gz: a8f411071943c4f155d8bc3a236c6b19d6cd6bdb5d938f327a3200d01f50f69c
5
5
  SHA512:
6
- metadata.gz: 56ed6bc3516d7d6551de28bee7db494aef1ba3632b63a1f1fa85e6f8b1c1d278c7d08d780ee56a8e3ad1a1302798944ecdc1abd71bcb394c153b003f72c3c12d
7
- data.tar.gz: 2292a387d814b7ac3c80548528ef03a6a8c25d6d164ac05ad9b0ab568104a690ae9d78a069c75d9bb35370067475e7ccb2387c42c198ccfefbbe24ca6d437e19
6
+ metadata.gz: 82bffc4da578b0a27c2d74cf7e8381263fd0f4d1eb185a995c8b0c0afcd67472b9216d7f0765f36a9c1438b64121967f623cd4f9c4704a88306ca76cb761d135
7
+ data.tar.gz: 330f4a48d65f629d7f6352824e43c325af5ee98c5b94358b5a0bb4661870db4fbc39914c377fbd5ff3ce9a49c6e6fc50419d525aff153a3ae36352a1d1133e6c
@@ -139,11 +139,9 @@ module Nanoc
139
139
  end
140
140
 
141
141
  # @see ARGF.set_encoding
142
- # rubocop:disable Naming/AccessorMethodName
143
142
  def set_encoding(*args)
144
143
  @stream.set_encoding(*args)
145
144
  end
146
- # rubocop:enable Naming/AccessorMethodName
147
145
 
148
146
  protected
149
147
 
@@ -105,25 +105,26 @@ module Nanoc::CLI::Commands
105
105
  raise Nanoc::Core::Errors::InternalInconsistency, "unexpected pred type #{pred.inspect}"
106
106
  end
107
107
 
108
- pred_identifier =
108
+ details =
109
109
  case pred
110
110
  when Nanoc::Core::Document
111
- pred.identifier.to_s
111
+ [pred.identifier.to_s]
112
112
  when Nanoc::Core::Configuration, nil
113
- nil
113
+ []
114
114
  when Nanoc::Core::IdentifiableCollection
115
- case dep.props.raw_content
116
- when true
117
- 'matching any'
118
- else
119
- "matching any of #{dep.props.raw_content.sort.join(', ')}"
120
- end
115
+ describe_identifiable_collection_dependency(dep)
121
116
  else
122
117
  raise Nanoc::Core::Errors::InternalInconsistency, "unexpected pred type #{pred.inspect}"
123
118
  end
124
119
 
125
120
  if pred
126
- puts " [ #{format '%6s', type} ] (#{dep.props}) #{pred_identifier}"
121
+ print " [ #{format '%7s', type} ] (#{dep.props})"
122
+
123
+ if details.any?
124
+ print ' '
125
+ end
126
+
127
+ puts details.join("\n ")
127
128
  else
128
129
  puts ' ( removed )'
129
130
  end
@@ -132,6 +133,47 @@ module Nanoc::CLI::Commands
132
133
  end
133
134
  end
134
135
 
136
+ def describe_identifiable_collection_dependency(dep)
137
+ outcome = []
138
+
139
+ case dep.props.raw_content
140
+ when true
141
+ outcome << 'matching any identifier'
142
+ when Set
143
+ dep.props.raw_content.sort.each do |x|
144
+ outcome << "matching identifier #{x}"
145
+ end
146
+ end
147
+
148
+ if dep.props.attributes
149
+ case dep.props.attributes
150
+ when true
151
+ outcome << 'matching any attribute'
152
+ when Set
153
+ dep.props.attributes.each do |elem|
154
+ case elem
155
+ when Symbol
156
+ outcome << "matching attribute #{elem.inspect} (any value)"
157
+ when Array
158
+ outcome << "matching attribute pair #{elem[0].inspect} => #{elem[1].inspect}"
159
+ else
160
+ raise(
161
+ Nanoc::Core::Errors::InternalInconsistency,
162
+ "unexpected prop attribute element #{elem.inspect}",
163
+ )
164
+ end
165
+ end
166
+ else
167
+ raise(
168
+ Nanoc::Core::Errors::InternalInconsistency,
169
+ "unexpected prop attribute #{dep.props.attributes.inspect}",
170
+ )
171
+ end
172
+ end
173
+
174
+ outcome
175
+ end
176
+
135
177
  def print_item_rep_paths(items, reps)
136
178
  print_header('Item representation paths')
137
179
 
@@ -4,11 +4,11 @@ usage 'view [options]'
4
4
  summary 'start the web server that serves static files'
5
5
  description <<~EOS
6
6
  Start the static web server. Unless specified, the web server will run on port
7
- 3000 and listen on all IP addresses. Running this static web server requires
7
+ 3000 and listen 127.0.0.1. Running this static web server requires
8
8
  `adsf` (not `asdf`!).
9
9
  EOS
10
10
 
11
- required :H, :handler, 'specify the handler to use (webrick/mongrel/...)'
11
+ required :H, :handler, 'specify the handler to use (webrick/puma/...)'
12
12
  required :o, :host, 'specify the host to listen on (default: 127.0.0.1)', default: '127.0.0.1'
13
13
  required :p, :port, 'specify the port to listen on (default: 3000)', transform: Nanoc::CLI::Transform::Port, default: 3000
14
14
  flag :L, :'live-reload', 'reload on changes'
@@ -25,6 +25,8 @@ module Nanoc::CLI::CompileListeners
25
25
 
26
26
  # @see Listener#start
27
27
  def start
28
+ Nanoc::Core::Instrumentor.enable
29
+
28
30
  on(:stage_ran) do |duration, klass|
29
31
  @stages_summary.observe(duration, name: klass.to_s.sub(/.*::/, ''))
30
32
  end
@@ -65,6 +67,8 @@ module Nanoc::CLI::CompileListeners
65
67
 
66
68
  # @see Listener#stop
67
69
  def stop
70
+ Nanoc::Core::Instrumentor.disable
71
+
68
72
  print_profiling_feedback
69
73
  end
70
74
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module CLI
5
- VERSION = '4.12.7'
5
+ VERSION = '4.12.9'
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.12.7
4
+ version: 4.12.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-06 00:00:00.000000000 Z
11
+ date: 2022-10-08 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.12.7
47
+ version: 4.12.9
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.12.7
54
+ version: 4.12.9
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: zeitwerk
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubygems_version: 3.3.15
124
+ rubygems_version: 3.3.22
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: CLI for Nanoc