Class: Generators::MERBGenerator

Inherits:
Object
  • Object
show all
Includes:
MarkUp
Defined in:
lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb,
lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MarkUp

#cvs_url, #markup, #style_url

Constructor Details

#initialize(options) ⇒ MERBGenerator

Set up a new HTML generator. Basically all we do here is load up the correct output temlate



1152
1153
1154
1155
# File 'lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb', line 1152

def initialize(options) #:not-new:
    @options    = options
    load_html_template
end

Class Method Details

.for(options) ⇒ Object

Generators may need to return specific subclasses depending on the options they are passed. Because of this we create them using a factory



1137
1138
1139
1140
1141
1142
1143
# File 'lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb', line 1137

def MERBGenerator.for(options)
    AllReferences::reset
    HtmlMethod::reset

    MERBGenerator.new(options)

end

Instance Method Details

#generate(toplevels) ⇒ Object

Build the initial indices and output objects based on an array of TopLevel objects containing the extracted information.



1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
# File 'lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb', line 1163

def generate(toplevels)
    @toplevels  = toplevels
    @files      = []
    @classes    = []

    write_style_sheet
    write_javascript
    gen_sub_directories()
    build_indices
    generate_html
end