class YARD::CLI::Stats
Monkey patch the stats object to return statistics for our objects. This is the recommended way to add custom stats. @private
Public Instance Methods
output(name, data, undoc = nil)
click to toggle source
# File lib/puppet-strings/yard.rb, line 111 def output(name, data, undoc = nil) # Monkey patch output to accommodate our larger header widths @total += data if data.is_a?(Integer) && undoc @undocumented += undoc if undoc.is_a?(Integer) data = if undoc "#{data} (#{undoc} undocumented)" else data.to_s end log.puts("#{name.ljust(25)} #{data}") end
stats_for_puppet_classes()
click to toggle source
# File lib/puppet-strings/yard.rb, line 73 def stats_for_puppet_classes output 'Puppet Classes', *type_statistics_all(:puppet_class) end
stats_for_puppet_data_type_aliases()
click to toggle source
# File lib/puppet-strings/yard.rb, line 81 def stats_for_puppet_data_type_aliases output 'Puppet Data Type Aliases', *type_statistics_all(:puppet_data_type_alias) end
stats_for_puppet_data_types()
click to toggle source
# File lib/puppet-strings/yard.rb, line 77 def stats_for_puppet_data_types output 'Puppet Data Types', *type_statistics_all(:puppet_data_type) end
stats_for_puppet_defined_types()
click to toggle source
# File lib/puppet-strings/yard.rb, line 85 def stats_for_puppet_defined_types output 'Puppet Defined Types', *type_statistics_all(:puppet_defined_type) end
stats_for_puppet_functions()
click to toggle source
# File lib/puppet-strings/yard.rb, line 97 def stats_for_puppet_functions output 'Puppet Functions', *type_statistics_all(:puppet_function) end
stats_for_puppet_plans()
click to toggle source
# File lib/puppet-strings/yard.rb, line 105 def stats_for_puppet_plans return unless PuppetStrings.puppet_5? output 'Puppet Plans', *type_statistics_all(:puppet_plan) end
stats_for_puppet_providers()
click to toggle source
# File lib/puppet-strings/yard.rb, line 93 def stats_for_puppet_providers output 'Puppet Providers', *type_statistics_all(:puppet_provider) end
stats_for_puppet_tasks()
click to toggle source
# File lib/puppet-strings/yard.rb, line 101 def stats_for_puppet_tasks output 'Puppet Tasks', *type_statistics_all(:puppet_task) end
stats_for_puppet_types()
click to toggle source
# File lib/puppet-strings/yard.rb, line 89 def stats_for_puppet_types output 'Puppet Types', *type_statistics_all(:puppet_type) end
type_statistics_all(type)
click to toggle source
This differs from the YARD
implementation in that it considers a docstring without text but with tags to be undocumented.
# File lib/puppet-strings/yard.rb, line 126 def type_statistics_all(type) objs = all_objects.select { |m| m.type == type } undoc = objs.select { |m| m.docstring.all.empty? } @undoc_list |= undoc if @undoc_list [objs.size, undoc.size] end