# 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, line 706
    def initialize(context, html_file, prefix, options)
      super(context, options)

      @html_file = html_file
      @is_module = false
      @values    = {}

      context.viewer = self

      if options.all_one_file
        @path = context.full_name
      else
        @path = http_url(context.full_name, prefix)
      end

      AllReferences.add("PLUGIN(#{@context.full_name})", self)
    end

### Public Instance Methods

<=>(other) click to toggle source

    # File lib/puppet/util/rdoc/generators/puppet_generator.rb, line 817
    def <=>(other)
      self.name <=> other.name
    end

attribute_values() click to toggle source

    # File lib/puppet/util/rdoc/generators/puppet_generator.rb, line 788
    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}"

      c = @context
      @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) 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, line 730
    def http_url(full_name, prefix)
      path = full_name.dup
      path.gsub!(/<<\s*(\w*)/) { "from-#$1" } if path['<<']
      File.join(prefix, path.split("::")) + ".html"
    end

index_name() click to toggle source

    # File lib/puppet/util/rdoc/generators/puppet_generator.rb, line 740
    def index_name
      name
    end

name() click to toggle source

    # File lib/puppet/util/rdoc/generators/puppet_generator.rb, line 724
    def name
      @context.name
    end

parent_name() click to toggle source

    # File lib/puppet/util/rdoc/generators/puppet_generator.rb, line 736
    def parent_name
      @context.parent.full_name
    end

value_hash() click to toggle source

    # File lib/puppet/util/rdoc/generators/puppet_generator.rb, line 755
    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) click to toggle source

    # File lib/puppet/util/rdoc/generators/puppet_generator.rb, line 744
    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