Class: Generators::HTMLPuppetPlugin
- Defined in:
- lib/puppet/util/rdoc/generators/puppet_generator.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #attribute_values ⇒ Object
-
#http_url(full_name, prefix) ⇒ Object
return the relative file name to store this class in, which is also its url.
- #index_name ⇒ Object
-
#initialize(context, html_file, prefix, options) ⇒ HTMLPuppetPlugin
constructor
A new instance of HTMLPuppetPlugin.
- #name ⇒ Object
- #parent_name ⇒ Object
- #value_hash ⇒ Object
- #write_on(f) ⇒ Object
Constructor Details
#initialize(context, html_file, prefix, options) ⇒ HTMLPuppetPlugin
Returns a new instance of HTMLPuppetPlugin.
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 701 def initialize(context, html_file, prefix, ) super(context, ) @html_file = html_file @is_module = false @values = {} context.viewer = self if .all_one_file @path = context.full_name else @path = http_url(context.full_name, prefix) end AllReferences.add("PLUGIN(#{@context.full_name})", self) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
699 700 701 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 699 def path @path end |
Instance Method Details
#<=>(other) ⇒ Object
811 812 813 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 811 def <=>(other) name <=> other.name end |
#attribute_values ⇒ Object
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 783 def attribute_values h_name = CGI.escapeHTML(name) if @context.is_fact? @values["classmod"] = "Fact" else @values["classmod"] = "Plugin" end @values["title"] = "#{@values['classmod']}: #{h_name}" @values["full_name"] = h_name files = [] @context.in_files.each do |f| res = {} full_path = CGI.escapeHTML(f.file_absolute_name) res["full_path"] = full_path res["full_path_url"] = aref_to(f.viewer.path) if f.document_self res["cvsurl"] = cvs_url(@options.webcvs, full_path) if @options.webcvs files << res end @values['infiles'] = files end |
#http_url(full_name, prefix) ⇒ Object
return the relative file name to store this class in, which is also its url
725 726 727 728 729 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 725 def http_url(full_name, prefix) path = full_name.dup path.gsub!(/<<\s*(\w*)/) { "from-#{::Regexp.last_match(1)}" } if path['<<'] File.join(prefix, path.split("::")) + ".html" end |
#index_name ⇒ Object
735 736 737 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 735 def index_name name end |
#name ⇒ Object
719 720 721 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 719 def name @context.name end |
#parent_name ⇒ Object
731 732 733 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 731 def parent_name @context.parent.full_name end |
#value_hash ⇒ Object
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 750 def value_hash attribute_values add_table_of_sections @values["charset"] = @options.charset @values["style_url"] = style_url(path, @options.css) d = markup(@context.comment) @values["description"] = d unless d.empty? if context.is_fact? unless context.confine.empty? res = {} res["type"] = context.confine[:type] res["value"] = context.confine[:value] @values["confine"] = [res] end else @values["type"] = context.type end @values["sections"] = @context.sections.map do |section| secdata = { "sectitle" => section.title, "secsequence" => section.sequence, "seccomment" => markup(section.comment) } secdata end @values end |
#write_on(f) ⇒ Object
739 740 741 742 743 744 745 746 747 748 |
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 739 def write_on(f) value_hash template = TemplatePage.new( RDoc::Page::BODYINC, RDoc::Page::PLUGIN_PAGE, RDoc::Page::PLUGIN_LIST ) template.write_html_on(f, @values) end |