Class: RDoc::Generator::SDoc
- Inherits:
-
Object
- Object
- RDoc::Generator::SDoc
- Includes:
- ERB::Util, SDoc::GitHub, SDoc::Helpers, SDoc::Templatable
- Defined in:
- lib/sdoc/generator.rb
Defined Under Namespace
Classes: FilesTree
Constant Summary collapse
- DESCRIPTION =
'Searchable HTML documentation'
- GENERATOR_DIRS =
[File.join('sdoc', 'generator')]
- TREE_FILE =
File.join 'panel', 'tree.js'
- SEARCH_INDEX_FILE =
File.join 'js', 'search_index.js'
- FILE_DIR =
'files'
- CLASS_DIR =
'classes'
- RESOURCES_DIR =
File.join('resources', '.')
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
readonly
Returns the value of attribute base_dir.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#store ⇒ Object
readonly
The RDoc::Store that is the source of the generated content.
Class Method Summary collapse
Instance Method Summary collapse
- #class_dir ⇒ Object
- #file_dir ⇒ Object
- #generate ⇒ Object
-
#initialize(store, options) ⇒ SDoc
constructor
A new instance of SDoc.
Constructor Details
#initialize(store, options) ⇒ SDoc
Returns a new instance of SDoc.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/sdoc/generator.rb', line 69 def initialize(store, ) @store = store @options = if @options.respond_to?('diagram=') @options.diagram = false end @options.pipe = true @github_url_cache = {} @template_dir = Pathname.new(.template_dir) @base_dir = Pathname.pwd. @json_index = RDoc::Generator::JsonIndex.new self, end |
Instance Attribute Details
#base_dir ⇒ Object (readonly)
Returns the value of attribute base_dir.
43 44 45 |
# File 'lib/sdoc/generator.rb', line 43 def base_dir @base_dir end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
45 46 47 |
# File 'lib/sdoc/generator.rb', line 45 def @options end |
#store ⇒ Object (readonly)
The RDoc::Store that is the source of the generated content
50 51 52 |
# File 'lib/sdoc/generator.rb', line 50 def store @store end |
Class Method Details
.setup_options(options) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/sdoc/generator.rb', line 52 def self.() opt = .option_parser opt.separator nil opt.separator "SDoc generator options:" opt.separator nil opt.on("--github", "-g", "Generate links to github.") do |value| .github = true end opt.separator nil opt.on("--version", "-v", "Output current version") do puts SDoc::VERSION exit end end |
Instance Method Details
#class_dir ⇒ Object
101 102 103 |
# File 'lib/sdoc/generator.rb', line 101 def class_dir CLASS_DIR end |
#file_dir ⇒ Object
105 106 107 |
# File 'lib/sdoc/generator.rb', line 105 def file_dir FILE_DIR end |
#generate ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/sdoc/generator.rb', line 84 def generate @outputdir = Pathname.new(@options.op_dir).(@base_dir) @files = @store.all_files.sort @classes = @store.all_classes_and_modules.sort # Now actually write the output copy_resources @json_index.generate @json_index.generate_gzipped generate_search_index generate_class_tree generate_index_file generate_file_files generate_class_files end |