Class: RDoc::Generator::R2DOC

Inherits:
HTML
  • Object
show all
Includes:
ERB::Util, R2Doc::Generator, R2Doc::TemplateUtil
Defined in:
lib/r2doc/rdoc_v2_generator.rb

Overview

R2Doc generator for RDoc v2

Class Method Summary collapse

Instance Method Summary collapse

Methods included from R2Doc::Generator

#generate

Methods included from R2Doc::TemplateUtil

#content_tag, gen_url, #link_to, #path_to, #render_partial, #stripe_class

Constructor Details

#initialize(*args) ⇒ R2DOC

Constructor



73
74
75
76
# File 'lib/r2doc/rdoc_v2_generator.rb', line 73

def initialize(*args)
  super
  build_static_file_list
end

Class Method Details

.for(options) ⇒ Object

Factory method



68
69
70
# File 'lib/r2doc/rdoc_v2_generator.rb', line 68

def R2DOC.for(options)
  R2DOC.new(options)
end

Instance Method Details

#complete_method_listObject

Return a list of all defined methods



104
105
106
# File 'lib/r2doc/rdoc_v2_generator.rb', line 104

def complete_method_list
  Method.all_methods
end

#create_class_context(context, file, options) ⇒ Object

Create a new class object for this RDoc version



99
100
101
# File 'lib/r2doc/rdoc_v2_generator.rb', line 99

def create_class_context(context, file, options)
  Class.new(@template_cache, context, file, CLASS_DIR, options)
end

#create_file_context(context, options) ⇒ Object

Create a new file object for this RDoc version



94
95
96
# File 'lib/r2doc/rdoc_v2_generator.rb', line 94

def create_file_context(context, options)
  File.new(@template_cache, context, options, FILE_DIR)
end

#generate_prepObject

Perform version-specific initialization



79
80
81
# File 'lib/r2doc/rdoc_v2_generator.rb', line 79

def generate_prep
  @template_cache = Cache.instance
end

#get_toplevelsObject

Return the list of top level objects for this RDoc version



89
90
91
# File 'lib/r2doc/rdoc_v2_generator.rb', line 89

def get_toplevels
  TopLevel
end

#template_nameObject

Return the name of the template



84
85
86
# File 'lib/r2doc/rdoc_v2_generator.rb', line 84

def template_name
  @options.template || 'r2doc'
end