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
709 def initialize(context, html_file, prefix, options)
710   super(context, options)
711 
712   @html_file = html_file
713   @is_module = false
714   @values    = {}
715 
716   context.viewer = self
717 
718   if options.all_one_file
719     @path = context.full_name
720   else
721     @path = http_url(context.full_name, prefix)
722   end
723 
724   AllReferences.add("PLUGIN(#{@context.full_name})", self)
725 end

Public Instance Methods

<=>(other) click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
819 def <=>(other)
820   self.name <=> other.name
821 end
attribute_values() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
791 def attribute_values
792   h_name = CGI.escapeHTML(name)
793 
794   if @context.is_fact?
795     @values["classmod"]  = "Fact"
796   else
797     @values["classmod"]  = "Plugin"
798   end
799   @values["title"]     = "#{@values['classmod']}: #{h_name}"
800 
801   @values["full_name"] = h_name
802 
803   files = []
804   @context.in_files.each do |f|
805     res = {}
806     full_path = CGI.escapeHTML(f.file_absolute_name)
807 
808     res["full_path"]     = full_path
809     res["full_path_url"] = aref_to(f.viewer.path) if f.document_self
810 
811     res["cvsurl"] = cvs_url( @options.webcvs, full_path ) if @options.webcvs
812 
813     files << res
814   end
815 
816   @values['infiles'] = files
817 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
733 def http_url(full_name, prefix)
734   path = full_name.dup
735   path.gsub!(/<<\s*(\w*)/) { "from-#$1" } if path['<<']
736   File.join(prefix, path.split("::")) + ".html"
737 end
index_name() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
743 def index_name
744   name
745 end
name() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
727 def name
728   @context.name
729 end
parent_name() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
739 def parent_name
740   @context.parent.full_name
741 end
value_hash() click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
758 def value_hash
759   attribute_values
760   add_table_of_sections
761 
762   @values["charset"] = @options.charset
763   @values["style_url"] = style_url(path, @options.css)
764 
765   d = markup(@context.comment)
766   @values["description"] = d unless d.empty?
767 
768   if context.is_fact?
769     unless context.confine.empty?
770       res = {}
771       res["type"] = context.confine[:type]
772       res["value"] = context.confine[:value]
773       @values["confine"] = [res]
774     end
775   else
776     @values["type"] = context.type
777   end
778 
779   @values["sections"] = @context.sections.map do |section|
780     secdata = {
781       "sectitle" => section.title,
782       "secsequence" => section.sequence,
783       "seccomment" => markup(section.comment)
784     }
785     secdata
786   end
787 
788   @values
789 end
write_on(f) click to toggle source
    # File lib/puppet/util/rdoc/generators/puppet_generator.rb
747 def write_on(f)
748   value_hash
749 
750     template = TemplatePage.new(
751       RDoc::Page::BODYINC,
752         RDoc::Page::PLUGIN_PAGE,
753 
754         RDoc::Page::PLUGIN_LIST)
755   template.write_html_on(f, @values)
756 end