class Generators::HTMLPuppetPlugin

Attributes

path[R]

Public Class Methods

new(context, html_file, prefix, options) click to toggle source
Calls superclass method
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
708 def initialize(context, html_file, prefix, options)
709   super(context, options)
710 
711   @html_file = html_file
712   @is_module = false
713   @values    = {}
714 
715   context.viewer = self
716 
717   if options.all_one_file
718     @path = context.full_name
719   else
720     @path = http_url(context.full_name, prefix)
721   end
722 
723   AllReferences.add("PLUGIN(#{@context.full_name})", self)
724 end

Public Instance Methods

<=>(other) click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
818 def <=>(other)
819   self.name <=> other.name
820 end
attribute_values() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
790 def attribute_values
791   h_name = CGI.escapeHTML(name)
792 
793   if @context.is_fact?
794     @values["classmod"]  = "Fact"
795   else
796     @values["classmod"]  = "Plugin"
797   end
798   @values["title"]     = "#{@values['classmod']}: #{h_name}"
799 
800   @values["full_name"] = h_name
801 
802   files = []
803   @context.in_files.each do |f|
804     res = {}
805     full_path = CGI.escapeHTML(f.file_absolute_name)
806 
807     res["full_path"]     = full_path
808     res["full_path_url"] = aref_to(f.viewer.path) if f.document_self
809 
810     res["cvsurl"] = cvs_url( @options.webcvs, full_path ) if @options.webcvs
811 
812     files << res
813   end
814 
815   @values['infiles'] = files
816 end
http_url(full_name, prefix) click to toggle source

return the relative file name to store this class in, which is also its url

    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
732 def http_url(full_name, prefix)
733   path = full_name.dup
734   path.gsub!(/<<\s*(\w*)/) { "from-#$1" } if path['<<']
735   File.join(prefix, path.split("::")) + ".html"
736 end
index_name() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
742 def index_name
743   name
744 end
name() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
726 def name
727   @context.name
728 end
parent_name() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
738 def parent_name
739   @context.parent.full_name
740 end
value_hash() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
757 def value_hash
758   attribute_values
759   add_table_of_sections
760 
761   @values["charset"] = @options.charset
762   @values["style_url"] = style_url(path, @options.css)
763 
764   d = markup(@context.comment)
765   @values["description"] = d unless d.empty?
766 
767   if context.is_fact?
768     unless context.confine.empty?
769       res = {}
770       res["type"] = context.confine[:type]
771       res["value"] = context.confine[:value]
772       @values["confine"] = [res]
773     end
774   else
775     @values["type"] = context.type
776   end
777 
778   @values["sections"] = @context.sections.map do |section|
779     secdata = {
780       "sectitle" => section.title,
781       "secsequence" => section.sequence,
782       "seccomment" => markup(section.comment)
783     }
784     secdata
785   end
786 
787   @values
788 end
write_on(f) click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
746 def write_on(f)
747   value_hash
748 
749     template = TemplatePage.new(
750       RDoc::Page::BODYINC,
751         RDoc::Page::PLUGIN_PAGE,
752 
753         RDoc::Page::PLUGIN_LIST)
754   template.write_html_on(f, @values)
755 end