Method: TypeDoc#list_types

Defined in:
lib/vendor/puppet/application/describe.rb

#list_typesObject



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/vendor/puppet/application/describe.rb', line 66

def list_types
  puts "These are the types known to puppet:\n"
  @types.keys.sort { |a, b|
    a.to_s <=> b.to_s
  }.each do |name|
    type = @types[name]
    s = type.doc.gsub(/\s+/, " ")
    n = s.index(".")
    if n.nil?
      s = ".. no documentation .."
    elsif n > 45
      s = s[0, 45] + " ..."
    else
      s = s[0, n]
    end
    printf "%-15s - %s\n", name, s
  end
end