Class: Generators::HTMLPuppetModule

Inherits:
HtmlClass
  • Object
show all
Defined in:
lib/puppet/util/rdoc/generators/puppet_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(context, html_file, prefix, options) ⇒ HTMLPuppetModule


652
653
654
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 652

def initialize(context, html_file, prefix, options)
  super(context, html_file, prefix, options)
end

Instance Method Details

#build_facts_summary_listObject


687
688
689
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 687

def build_facts_summary_list
  potentially_referenced_list(context.facts) {|fn| ["PLUGIN(#{fn})"] }
end

#build_nodes_list(level, context) ⇒ Object


671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 671

def build_nodes_list(level, context)
  res = ""
  prefix = "  ::" * level;

  context.nodes.sort.each do |node|
    if node.document_self
      res <<
      prefix <<
      "Node " <<
      href(url(node.viewer.path), "link", node.full_name) <<
      "<br />\n"
    end
  end
  res
end

#build_plugins_summary_listObject


691
692
693
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 691

def build_plugins_summary_list
  potentially_referenced_list(context.plugins) {|fn| ["PLUGIN(#{fn})"] }
end

#factsObject


695
696
697
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 695

def facts
  @context.facts
end

#pluginsObject


699
700
701
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 699

def plugins
  @context.plugins
end

#value_hashObject


656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 656

def value_hash
  @values = super

  fl = build_facts_summary_list
  @values["facts"] = fl unless fl.empty?

  pl = build_plugins_summary_list
  @values["plugins"] = pl unless pl.empty?

  nl = build_nodes_list(0, @context)
  @values["nodelist"] = nl unless nl.empty?

  @values
end