nanoc 4.8.19 → 4.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/NEWS.md +21 -0
  4. data/lib/nanoc.rb +5 -4
  5. data/lib/nanoc/base/entities/directed_graph.rb +4 -4
  6. data/lib/nanoc/base/entities/identifier.rb +5 -0
  7. data/lib/nanoc/base/feature.rb +1 -2
  8. data/lib/nanoc/base/repos/dependency_store.rb +4 -4
  9. data/lib/nanoc/base/services/compiler/phases/abstract.rb +8 -0
  10. data/lib/nanoc/base/services/compiler/phases/write.rb +58 -1
  11. data/lib/nanoc/base/services/compiler/stages/compile_reps.rb +39 -29
  12. data/lib/nanoc/base/services/compiler/stages/determine_outdatedness.rb +2 -2
  13. data/lib/nanoc/base/services/instrumentor.rb +1 -1
  14. data/lib/nanoc/base/services/item_rep_writer.rb +2 -2
  15. data/lib/nanoc/base/views/compilation_item_rep_view.rb +7 -0
  16. data/lib/nanoc/checking.rb +4 -1
  17. data/lib/nanoc/checking/check.rb +7 -0
  18. data/lib/nanoc/checking/checks/external_links.rb +21 -12
  19. data/lib/nanoc/checking/dsl.rb +5 -7
  20. data/lib/nanoc/checking/loader.rb +50 -0
  21. data/lib/nanoc/checking/runner.rb +18 -40
  22. data/lib/nanoc/cli.rb +1 -1
  23. data/lib/nanoc/cli/ansi_string_colorizer.rb +4 -4
  24. data/lib/nanoc/cli/cleaning_stream.rb +12 -12
  25. data/lib/nanoc/cli/commands/check.rb +5 -15
  26. data/lib/nanoc/cli/commands/compile_listeners/diff_generator.rb +7 -7
  27. data/lib/nanoc/cli/commands/compile_listeners/file_action_printer.rb +12 -2
  28. data/lib/nanoc/cli/commands/compile_listeners/timing_recorder.rb +27 -19
  29. data/lib/nanoc/cli/commands/deploy.rb +1 -1
  30. data/lib/nanoc/cli/commands/show-rules.rb +2 -2
  31. data/lib/nanoc/cli/error_handler.rb +1 -4
  32. data/lib/nanoc/cli/stream_cleaners/abstract.rb +2 -2
  33. data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +2 -2
  34. data/lib/nanoc/cli/stream_cleaners/utf8.rb +2 -2
  35. data/lib/nanoc/data_sources/filesystem/parser.rb +1 -1
  36. data/lib/nanoc/deploying/deployers/fog.rb +3 -3
  37. data/lib/nanoc/extra.rb +1 -2
  38. data/lib/nanoc/filters/colorize_syntax.rb +2 -2
  39. data/lib/nanoc/filters/relativize_paths.rb +2 -2
  40. data/lib/nanoc/helpers/blogging.rb +11 -11
  41. data/lib/nanoc/rule_dsl/compilation_rule_context.rb +1 -1
  42. data/lib/nanoc/version.rb +1 -1
  43. metadata +27 -13
  44. data/lib/nanoc/extra/parallel_collection.rb +0 -57
@@ -3,17 +3,15 @@
3
3
  module Nanoc::Checking
4
4
  # @api private
5
5
  class DSL
6
- attr_reader :deploy_checks
7
-
8
- def self.from_file(filename)
9
- dsl = new
6
+ def self.from_file(filename, enabled_checks:)
7
+ dsl = new(enabled_checks: enabled_checks)
10
8
  absolute_filename = File.expand_path(filename)
11
9
  dsl.instance_eval(File.read(filename), absolute_filename)
12
10
  dsl
13
11
  end
14
12
 
15
- def initialize
16
- @deploy_checks = []
13
+ def initialize(enabled_checks:)
14
+ @enabled_checks = enabled_checks
17
15
  end
18
16
 
19
17
  def check(identifier, &block)
@@ -23,7 +21,7 @@ module Nanoc::Checking
23
21
  end
24
22
 
25
23
  def deploy_check(*identifiers)
26
- identifiers.each { |i| @deploy_checks << i }
24
+ identifiers.each { |i| @enabled_checks << i }
27
25
  end
28
26
  end
29
27
  end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nanoc::Checking
4
+ # @api private
5
+ class Loader
6
+ CHECKS_FILENAMES = ['Checks', 'Checks.rb', 'checks', 'checks.rb'].freeze
7
+
8
+ def initialize(config:)
9
+ @config = config
10
+ end
11
+
12
+ def run
13
+ dsl
14
+ end
15
+
16
+ def enabled_checks
17
+ (enabled_checks_from_dsl + enabled_checks_from_config).uniq
18
+ end
19
+
20
+ private
21
+
22
+ def dsl_present?
23
+ checks_filename && File.file?(checks_filename)
24
+ end
25
+
26
+ def enabled_checks_from_dsl
27
+ dsl
28
+ @enabled_checks_from_dsl
29
+ end
30
+
31
+ def enabled_checks_from_config
32
+ @config.fetch(:checking, {}).fetch(:enabled_checks, []).map(&:to_sym)
33
+ end
34
+
35
+ def dsl
36
+ @enabled_checks_from_dsl ||= []
37
+
38
+ @dsl ||=
39
+ if dsl_present?
40
+ Nanoc::Checking::DSL.from_file(checks_filename, enabled_checks: @enabled_checks_from_dsl)
41
+ else
42
+ Nanoc::Checking::DSL.new(enabled_checks: @enabled_checks_from_dsl)
43
+ end
44
+ end
45
+
46
+ def checks_filename
47
+ @_checks_filename ||= CHECKS_FILENAMES.find { |f| File.file?(f) }
48
+ end
49
+ end
50
+ end
@@ -5,29 +5,20 @@ module Nanoc::Checking
5
5
  #
6
6
  # @api private
7
7
  class Runner
8
- CHECKS_FILENAMES = ['Checks', 'Checks.rb', 'checks', 'checks.rb'].freeze
9
-
10
8
  # @param [Nanoc::Int::Site] site The Nanoc site this runner is for
11
9
  def initialize(site)
12
10
  @site = site
13
11
  end
14
12
 
15
- # @return [String] The name of the Checks file
16
- def checks_filename
17
- @_checks_filename ||= CHECKS_FILENAMES.find { |f| File.file?(f) }
18
- end
19
-
20
- # @return [Boolean] true if a Checks file exists, false otherwise
21
- def dsl_present?
22
- checks_filename && File.file?(checks_filename)
13
+ def any_enabled_checks?
14
+ enabled_checks.any?
23
15
  end
24
- alias has_dsl? dsl_present?
25
16
 
26
17
  # Lists all available checks on stdout.
27
18
  #
28
19
  # @return [void]
29
20
  def list_checks
30
- load_dsl_if_available
21
+ load_all
31
22
 
32
23
  puts 'Available checks:'
33
24
  puts
@@ -38,8 +29,7 @@ module Nanoc::Checking
38
29
  #
39
30
  # @return [Boolean] true if successful, false otherwise
40
31
  def run_all
41
- load_dsl_if_available
42
-
32
+ load_all
43
33
  run_check_classes(all_check_classes)
44
34
  end
45
35
 
@@ -47,10 +37,9 @@ module Nanoc::Checking
47
37
  #
48
38
  # @return [Boolean] true if successful, false otherwise
49
39
  def run_for_deploy
50
- require_dsl
51
-
52
- return true if dsl.nil?
53
- run_check_classes(check_classes_named(dsl.deploy_checks))
40
+ # TODO: rename to #run_enabled
41
+ load_all
42
+ run_check_classes(check_classes_named(enabled_checks))
54
43
  end
55
44
 
56
45
  # Runs the checks with the given names.
@@ -59,33 +48,22 @@ module Nanoc::Checking
59
48
  #
60
49
  # @return [Boolean] true if successful, false otherwise
61
50
  def run_specific(check_class_names)
62
- load_dsl_if_available
63
-
51
+ load_all
64
52
  run_check_classes(check_classes_named(check_class_names))
65
53
  end
66
54
 
67
- def load_dsl_if_available
68
- @dsl_loaded ||= false
69
- unless @dsl_loaded
70
- @dsl =
71
- if dsl_present?
72
- Nanoc::Checking::DSL.from_file(checks_filename)
73
- else
74
- nil
75
- end
76
- @dsl_loaded = true
77
- end
55
+ private
56
+
57
+ def loader
58
+ @loader ||= Nanoc::Checking::Loader.new(config: @site.config)
78
59
  end
79
60
 
80
- def require_dsl
81
- load_dsl_if_available
82
- if dsl.nil?
83
- raise Nanoc::Int::Errors::GenericTrivial, "No checks defined (no #{CHECKS_FILENAMES.first} file present)"
84
- end
61
+ def load_all
62
+ loader.run
85
63
  end
86
64
 
87
- def dsl
88
- @dsl
65
+ def enabled_checks
66
+ loader.enabled_checks
89
67
  end
90
68
 
91
69
  def run_check_classes(classes)
@@ -132,8 +110,8 @@ module Nanoc::Checking
132
110
  issues
133
111
  end
134
112
 
135
- def subject_to_s(s)
136
- s || '(global)'
113
+ def subject_to_s(str)
114
+ str || '(global)'
137
115
  end
138
116
 
139
117
  def print_issues(issues)
data/lib/nanoc/cli.rb CHANGED
@@ -230,7 +230,7 @@ module Nanoc::CLI
230
230
 
231
231
  # @return [Boolean] true if color support is present, false if not
232
232
  def self.enable_ansi_colors?(io)
233
- io.tty?
233
+ io.tty? && !ENV.key?('NO_COLOR')
234
234
  end
235
235
 
236
236
  def self.after_setup_procs
@@ -15,14 +15,14 @@ module Nanoc::CLI
15
15
  blue: "\e[34m",
16
16
  }.freeze
17
17
 
18
- # @param [String] s The string to colorize
18
+ # @param [String] str The string to colorize
19
19
  #
20
- # @param [Array] as An array of attributes from `MAPPING` to colorize the
20
+ # @param [Array] attrs An array of attributes from `MAPPING` to colorize the
21
21
  # string with
22
22
  #
23
23
  # @return [String] A string colorized using the given attributes
24
- def self.c(s, *as)
25
- as.map { |a| MAPPING[a] }.join('') + s + "\e[0m"
24
+ def self.c(str, *attrs)
25
+ attrs.map { |a| MAPPING[a] }.join('') + str + "\e[0m"
26
26
  end
27
27
  end
28
28
  end
@@ -40,16 +40,16 @@ module Nanoc::CLI
40
40
  # @group IO proxy methods
41
41
 
42
42
  # @see IO#write
43
- def write(s)
43
+ def write(str)
44
44
  _nanoc_swallow_broken_pipe_errors_while do
45
- @stream.write(_nanoc_clean(s))
45
+ @stream.write(_nanoc_clean(str))
46
46
  end
47
47
  end
48
48
 
49
49
  # @see IO#<<
50
- def <<(s)
50
+ def <<(str)
51
51
  _nanoc_swallow_broken_pipe_errors_while do
52
- @stream.<<(_nanoc_clean(s))
52
+ @stream.<<(_nanoc_clean(str))
53
53
  end
54
54
  end
55
55
 
@@ -76,16 +76,16 @@ module Nanoc::CLI
76
76
  end
77
77
 
78
78
  # @see IO#print
79
- def print(s)
79
+ def print(str)
80
80
  _nanoc_swallow_broken_pipe_errors_while do
81
- @stream.print(_nanoc_clean(s))
81
+ @stream.print(_nanoc_clean(str))
82
82
  end
83
83
  end
84
84
 
85
85
  # @see IO#puts
86
- def puts(*s)
86
+ def puts(*str)
87
87
  _nanoc_swallow_broken_pipe_errors_while do
88
- @stream.puts(*s.map { |ss| _nanoc_clean(ss) })
88
+ @stream.puts(*str.map { |ss| _nanoc_clean(ss) })
89
89
  end
90
90
  end
91
91
 
@@ -95,8 +95,8 @@ module Nanoc::CLI
95
95
  end
96
96
 
97
97
  # @see IO#reopen
98
- def reopen(*a)
99
- @stream.reopen(*a)
98
+ def reopen(*args)
99
+ @stream.reopen(*args)
100
100
  end
101
101
 
102
102
  # @see IO#close
@@ -148,8 +148,8 @@ module Nanoc::CLI
148
148
 
149
149
  protected
150
150
 
151
- def _nanoc_clean(s)
152
- @stream_cleaners.reduce(s.to_s.scrub) { |acc, elem| elem.clean(acc) }
151
+ def _nanoc_clean(str)
152
+ @stream_cleaners.reduce(str.to_s.scrub) { |acc, elem| elem.clean(acc) }
153
153
  end
154
154
 
155
155
  def _nanoc_swallow_broken_pipe_errors_while
@@ -3,17 +3,16 @@
3
3
  usage 'check [options] [names]'
4
4
  summary 'run issue checks'
5
5
  description "
6
- Run issue checks on the current site. If the `--all` option is passed, all available issue checks will be run. If the `--deploy` option is passed, the issue checks marked for deployment will be run.
6
+ Run issue checks on the current site. If the `--all` option is passed, all available issue checks will be run. By default, the issue checks marked for deployment will be run.
7
7
  "
8
8
 
9
9
  flag :a, :all, 'run all checks'
10
10
  flag :L, :list, 'list all checks'
11
- flag :d, :deploy, 'run checks for deployment'
11
+ flag :d, :deploy, '(deprecated)'
12
12
 
13
13
  module Nanoc::CLI::Commands
14
14
  class Check < ::Nanoc::CLI::CommandRunner
15
15
  def run
16
- validate_options_and_arguments
17
16
  site = load_site
18
17
 
19
18
  runner = Nanoc::Checking::Runner.new(site)
@@ -28,25 +27,16 @@ module Nanoc::CLI::Commands
28
27
  runner.run_all
29
28
  elsif options[:deploy]
30
29
  runner.run_for_deploy
31
- else
30
+ elsif arguments.any?
32
31
  runner.run_specific(arguments)
32
+ else
33
+ runner.run_for_deploy
33
34
  end
34
35
 
35
36
  unless success
36
37
  raise Nanoc::Int::Errors::GenericTrivial, 'One or more checks failed'
37
38
  end
38
39
  end
39
-
40
- protected
41
-
42
- def validate_options_and_arguments
43
- if arguments.empty? && !options[:all] && !options[:deploy] && !options[:list]
44
- raise(
45
- Nanoc::Int::Errors::GenericTrivial,
46
- 'nothing to do (pass either --all, --deploy or --list or a list of checks)',
47
- )
48
- end
49
- end
50
40
  end
51
41
  end
52
42
 
@@ -11,10 +11,10 @@ module Nanoc::CLI::Commands::CompileListeners
11
11
  def start
12
12
  setup_diffs
13
13
  old_contents = {}
14
- Nanoc::Int::NotificationCenter.on(:will_write_rep, self) do |rep, path|
14
+ Nanoc::Int::NotificationCenter.on(:rep_write_started, self) do |rep, path|
15
15
  old_contents[rep] = File.file?(path) ? File.read(path) : nil
16
16
  end
17
- Nanoc::Int::NotificationCenter.on(:rep_written, self) do |rep, binary, path, _is_created, _is_modified|
17
+ Nanoc::Int::NotificationCenter.on(:rep_write_ended, self) do |rep, binary, path, _is_created, _is_modified|
18
18
  unless binary
19
19
  new_contents = File.file?(path) ? File.read(path) : nil
20
20
  if old_contents[rep] && new_contents
@@ -29,8 +29,8 @@ module Nanoc::CLI::Commands::CompileListeners
29
29
  def stop
30
30
  super
31
31
 
32
- Nanoc::Int::NotificationCenter.remove(:will_write_rep, self)
33
- Nanoc::Int::NotificationCenter.remove(:rep_written, self)
32
+ Nanoc::Int::NotificationCenter.remove(:rep_write_started, self)
33
+ Nanoc::Int::NotificationCenter.remove(:rep_write_ended, self)
34
34
 
35
35
  teardown_diffs
36
36
  end
@@ -63,14 +63,14 @@ module Nanoc::CLI::Commands::CompileListeners
63
63
  end
64
64
  end
65
65
 
66
- def diff_strings(a, b)
66
+ def diff_strings(str_a, str_b)
67
67
  # Create files
68
68
  Tempfile.open('old') do |old_file|
69
69
  Tempfile.open('new') do |new_file|
70
70
  # Write files
71
- old_file.write(a)
71
+ old_file.write(str_a)
72
72
  old_file.flush
73
- new_file.write(b)
73
+ new_file.write(str_b)
74
74
  new_file.flush
75
75
 
76
76
  # Diff
@@ -25,7 +25,15 @@ module Nanoc::CLI::Commands::CompileListeners
25
25
  cached_reps << rep
26
26
  end
27
27
 
28
- Nanoc::Int::NotificationCenter.on(:rep_written, self) do |rep, _binary, path, is_created, is_modified|
28
+ Nanoc::Int::NotificationCenter.on(:rep_write_enqueued, self) do |rep|
29
+ @acc_durations[rep] += Time.now - @start_times[rep]
30
+ end
31
+
32
+ Nanoc::Int::NotificationCenter.on(:rep_write_started, self) do |rep, _raw_path|
33
+ @start_times[rep] = Time.now
34
+ end
35
+
36
+ Nanoc::Int::NotificationCenter.on(:rep_write_ended, self) do |rep, _binary, path, is_created, is_modified|
29
37
  @acc_durations[rep] += Time.now - @start_times[rep]
30
38
  duration = @acc_durations[rep]
31
39
 
@@ -50,7 +58,9 @@ module Nanoc::CLI::Commands::CompileListeners
50
58
 
51
59
  Nanoc::Int::NotificationCenter.remove(:compilation_started, self)
52
60
  Nanoc::Int::NotificationCenter.remove(:compilation_suspended, self)
53
- Nanoc::Int::NotificationCenter.remove(:rep_written, self)
61
+ Nanoc::Int::NotificationCenter.remove(:rep_write_enqueued, self)
62
+ Nanoc::Int::NotificationCenter.remove(:rep_write_started, self)
63
+ Nanoc::Int::NotificationCenter.remove(:rep_write_ended, self)
54
64
 
55
65
  @reps.reject(&:compiled?).each do |rep|
56
66
  raw_paths = rep.raw_paths.values.flatten.uniq
@@ -16,28 +16,28 @@ module Nanoc::CLI::Commands::CompileListeners
16
16
  def initialize(reps:)
17
17
  @reps = reps
18
18
 
19
- @stages_summary = DDTelemetry::Summary.new
20
- @phases_summary = DDTelemetry::Summary.new
21
- @outdatedness_rules_summary = DDTelemetry::Summary.new
22
- @filters_summary = DDTelemetry::Summary.new
23
- @load_stores_summary = DDTelemetry::Summary.new
19
+ @stages_summary = DDMetrics::Summary.new
20
+ @phases_summary = DDMetrics::Summary.new
21
+ @outdatedness_rules_summary = DDMetrics::Summary.new
22
+ @filters_summary = DDMetrics::Summary.new
23
+ @load_stores_summary = DDMetrics::Summary.new
24
24
  end
25
25
 
26
26
  # @see Listener#start
27
27
  def start
28
28
  on(:stage_ran) do |duration, klass|
29
- @stages_summary.observe(duration, klass.to_s.sub(/.*::/, ''))
29
+ @stages_summary.observe(duration, name: klass.to_s.sub(/.*::/, ''))
30
30
  end
31
31
 
32
32
  on(:outdatedness_rule_ran) do |duration, klass|
33
- @outdatedness_rules_summary.observe(duration, klass.to_s.sub(/.*::/, ''))
33
+ @outdatedness_rules_summary.observe(duration, name: klass.to_s.sub(/.*::/, ''))
34
34
  end
35
35
 
36
36
  filter_stopwatches = {}
37
37
 
38
38
  on(:filtering_started) do |rep, _filter_name|
39
39
  stopwatch_stack = filter_stopwatches.fetch(rep) { filter_stopwatches[rep] = [] }
40
- stopwatch_stack << DDTelemetry::Stopwatch.new
40
+ stopwatch_stack << DDMetrics::Stopwatch.new
41
41
  stopwatch_stack.last.start
42
42
  end
43
43
 
@@ -45,11 +45,11 @@ module Nanoc::CLI::Commands::CompileListeners
45
45
  stopwatch = filter_stopwatches.fetch(rep).pop
46
46
  stopwatch.stop
47
47
 
48
- @filters_summary.observe(stopwatch.duration, filter_name.to_s)
48
+ @filters_summary.observe(stopwatch.duration, name: filter_name.to_s)
49
49
  end
50
50
 
51
51
  on(:store_loaded) do |duration, klass|
52
- @load_stores_summary.observe(duration, klass.to_s)
52
+ @load_stores_summary.observe(duration, name: klass.to_s)
53
53
  end
54
54
 
55
55
  on(:compilation_suspended) do |rep, _exception|
@@ -64,14 +64,14 @@ module Nanoc::CLI::Commands::CompileListeners
64
64
 
65
65
  on(:phase_started) do |phase_name, rep|
66
66
  stopwatches = phase_stopwatches.fetch(rep) { phase_stopwatches[rep] = {} }
67
- stopwatches[phase_name] = DDTelemetry::Stopwatch.new.tap(&:start)
67
+ stopwatches[phase_name] = DDMetrics::Stopwatch.new.tap(&:start)
68
68
  end
69
69
 
70
70
  on(:phase_ended) do |phase_name, rep|
71
71
  stopwatch = phase_stopwatches.fetch(rep).fetch(phase_name)
72
72
  stopwatch.stop
73
73
 
74
- @phases_summary.observe(stopwatch.duration, phase_name)
74
+ @phases_summary.observe(stopwatch.duration, name: phase_name)
75
75
  end
76
76
 
77
77
  on(:phase_yielded) do |phase_name, rep|
@@ -88,7 +88,7 @@ module Nanoc::CLI::Commands::CompileListeners
88
88
  stopwatch = phase_stopwatches.fetch(rep).fetch(phase_name)
89
89
  stopwatch.stop if stopwatch.running?
90
90
 
91
- @phases_summary.observe(stopwatch.duration, phase_name)
91
+ @phases_summary.observe(stopwatch.duration, name: phase_name)
92
92
  end
93
93
  end
94
94
 
@@ -103,7 +103,9 @@ module Nanoc::CLI::Commands::CompileListeners
103
103
  def table_for_summary(name, summary)
104
104
  headers = [name.to_s, 'count', 'min', '.50', '.90', '.95', 'max', 'tot']
105
105
 
106
- rows = summary.map do |filter_name, stats|
106
+ rows = summary.map do |label, stats|
107
+ name = label.fetch(:name)
108
+
107
109
  count = stats.count
108
110
  min = stats.min
109
111
  p50 = stats.quantile(0.50)
@@ -112,7 +114,7 @@ module Nanoc::CLI::Commands::CompileListeners
112
114
  tot = stats.sum
113
115
  max = stats.max
114
116
 
115
- [filter_name, count.to_s] + [min, p50, p90, p95, max, tot].map { |r| "#{format('%4.2f', r)}s" }
117
+ [name, count.to_s] + [min, p50, p90, p95, max, tot].map { |r| "#{format('%4.2f', r)}s" }
116
118
  end
117
119
 
118
120
  [headers] + rows
@@ -121,8 +123,9 @@ module Nanoc::CLI::Commands::CompileListeners
121
123
  def table_for_summary_durations(name, summary)
122
124
  headers = [name.to_s, 'tot']
123
125
 
124
- rows = summary.map do |stage_name, stats|
125
- [stage_name, "#{format('%4.2f', stats.sum)}s"]
126
+ rows = summary.map do |label, stats|
127
+ name = label.fetch(:name)
128
+ [name, "#{format('%4.2f', stats.sum)}s"]
126
129
  end
127
130
 
128
131
  [headers] + rows
@@ -134,7 +137,7 @@ module Nanoc::CLI::Commands::CompileListeners
134
137
  print_table_for_summary_duration(:stages, @stages_summary) if Nanoc::CLI.verbosity >= 2
135
138
  print_table_for_summary(:outdatedness_rules, @outdatedness_rules_summary) if Nanoc::CLI.verbosity >= 2
136
139
  print_table_for_summary_duration(:load_stores, @load_stores_summary) if Nanoc::CLI.verbosity >= 2
137
- DDMemoize.print_telemetry if Nanoc::CLI.verbosity >= 2
140
+ print_ddmemoize_metrics if Nanoc::CLI.verbosity >= 2
138
141
  end
139
142
 
140
143
  def print_table_for_summary(name, summary)
@@ -151,8 +154,13 @@ module Nanoc::CLI::Commands::CompileListeners
151
154
  print_table(table_for_summary_durations(name, summary))
152
155
  end
153
156
 
157
+ def print_ddmemoize_metrics
158
+ puts
159
+ DDMemoize.print_metrics
160
+ end
161
+
154
162
  def print_table(rows)
155
- puts DDTelemetry::Table.new(rows).to_s
163
+ puts DDMetrics::Table.new(rows).to_s
156
164
  end
157
165
  end
158
166
  end