Class: Toys::Templates::Rdoc
- Inherits:
-
Object
- Object
- Toys::Templates::Rdoc
- Includes:
- Template
- Defined in:
- lib/toys/templates/rdoc.rb
Overview
A template that generates rdoc tools.
Constant Summary collapse
- DEFAULT_GEM_VERSION_REQUIREMENTS =
Default version requirements for the rdoc gem.
["~> 6.1.0"].freeze
- DEFAULT_TOOL_NAME =
Default tool name
"rdoc"
- DEFAULT_OUTPUT_DIR =
Default output directory
"html"
- DEFAULT_FILES =
Default file globs
["lib/**/*.rb"].freeze
Instance Attribute Summary collapse
-
#bundler ⇒ Boolean, Hash
writeonly
Set the bundler state and options for this tool.
-
#files ⇒ Array<String>
writeonly
An array of globs indicating which files to document.
-
#gem_version ⇒ String, ...
writeonly
Version requirements for the rdoc gem.
-
#generator ⇒ String?
writeonly
Name of the format generator.
-
#main ⇒ String?
writeonly
Name of the file to use as the main top level document, or
nil
for no top level document. -
#markup ⇒ String?
writeonly
Markup format.
-
#name ⇒ String
writeonly
Name of the tool to create.
-
#options ⇒ Array<String>
writeonly
Additional options to pass to RDoc.
-
#output_dir ⇒ String?
writeonly
Name of directory to receive html output files.
-
#template ⇒ String?
writeonly
Name of the template to use.
-
#title ⇒ String?
writeonly
Title of RDoc documentation pages.
Instance Method Summary collapse
-
#initialize(name: nil, gem_version: nil, files: nil, output_dir: nil, markup: nil, title: nil, main: nil, template: nil, generator: nil, options: [], bundler: false) ⇒ Rdoc
constructor
Create the template settings for the Rdoc template.
-
#use_bundler(**opts) ⇒ self
Use bundler for this tool.
Constructor Details
#initialize(name: nil, gem_version: nil, files: nil, output_dir: nil, markup: nil, title: nil, main: nil, template: nil, generator: nil, options: [], bundler: false) ⇒ Rdoc
Create the template settings for the Rdoc template.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/toys/templates/rdoc.rb', line 64 def initialize(name: nil, gem_version: nil, files: nil, output_dir: nil, markup: nil, title: nil, main: nil, template: nil, generator: nil, options: [], bundler: false) @name = name @gem_version = gem_version @files = files @output_dir = output_dir @markup = markup @title = title @main = main @template = template @generator = generator @options = @bundler = bundler end |
Instance Attribute Details
#bundler=(value) ⇒ Boolean, Hash (writeonly)
Set the bundler state and options for this tool.
Pass false
to disable bundler. Pass true
or a hash of options to
enable bundler. See the documentation for the
bundler mixin
for information on the options that can be passed.
188 189 190 |
# File 'lib/toys/templates/rdoc.rb', line 188 def bundler=(value) @bundler = value end |
#files=(value) ⇒ Array<String>
An array of globs indicating which files to document.
113 114 115 |
# File 'lib/toys/templates/rdoc.rb', line 113 def files=(value) @files = value end |
#gem_version=(value) ⇒ String, ...
Version requirements for the rdoc gem.
If set to nil
, uses the bundled version if bundler is enabled, or
defaults to DEFAULT_GEM_VERSION_REQUIREMENTS if bundler is not
enabled.
105 106 107 |
# File 'lib/toys/templates/rdoc.rb', line 105 def gem_version=(value) @gem_version = value end |
#generator=(value) ⇒ String?
Name of the format generator.
If set to nil
, RDoc will use its default generator.
167 168 169 |
# File 'lib/toys/templates/rdoc.rb', line 167 def generator=(value) @generator = value end |
#main=(value) ⇒ String?
Name of the file to use as the main top level document, or nil
for
no top level document.
149 150 151 |
# File 'lib/toys/templates/rdoc.rb', line 149 def main=(value) @main = value end |
#markup=(value) ⇒ String?
Markup format. Allowed values include "rdoc", "rd", and "tomdoc".
If set to nil
, RDoc will use its default markup, which is "rdoc".
131 132 133 |
# File 'lib/toys/templates/rdoc.rb', line 131 def markup=(value) @markup = value end |
#name=(value) ⇒ String
Name of the tool to create.
94 95 96 |
# File 'lib/toys/templates/rdoc.rb', line 94 def name=(value) @name = value end |
#options=(value) ⇒ Array<String>
Additional options to pass to RDoc
175 176 177 |
# File 'lib/toys/templates/rdoc.rb', line 175 def (value) @options = value end |
#output_dir=(value) ⇒ String?
Name of directory to receive html output files.
If set to nil
, defaults to DEFAULT_OUTPUT_DIR.
122 123 124 |
# File 'lib/toys/templates/rdoc.rb', line 122 def output_dir=(value) @output_dir = value end |
#template=(value) ⇒ String?
Name of the template to use.
If set to nil
, RDoc will choose a default template.
158 159 160 |
# File 'lib/toys/templates/rdoc.rb', line 158 def template=(value) @template = value end |
#title=(value) ⇒ String?
Title of RDoc documentation pages.
If set to nil
, RDoc will use a default title.
140 141 142 |
# File 'lib/toys/templates/rdoc.rb', line 140 def title=(value) @title = value end |
Instance Method Details
#use_bundler(**opts) ⇒ self
Use bundler for this tool.
See the documentation for the bundler mixin for information on the options that can be passed.
200 201 202 203 |
# File 'lib/toys/templates/rdoc.rb', line 200 def use_bundler(**opts) @bundler = opts self end |