Class: Toys::Templates::Rdoc
- Inherits:
-
Object
- Object
- Toys::Templates::Rdoc
- Includes:
- Toys::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.
-
#context_directory ⇒ String
writeonly
Custom context directory 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, context_directory: nil) ⇒ Rdoc
constructor
Create the template settings for the Rdoc template.
-
#use_bundler(**opts) ⇒ self
Use bundler for this tool.
Methods included from Toys::Template
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, context_directory: nil) ⇒ Rdoc
Create the template settings for the Rdoc template.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/toys/templates/rdoc.rb', line 66 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, context_directory: nil) @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 @context_directory = context_directory 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.
200 201 202 |
# File 'lib/toys/templates/rdoc.rb', line 200 def bundler=(value) @bundler = value end |
#context_directory=(value) ⇒ String
Custom context directory for this tool.
187 188 189 |
# File 'lib/toys/templates/rdoc.rb', line 187 def context_directory=(value) @context_directory = value end |
#files=(value) ⇒ Array<String>
An array of globs indicating which files to document.
117 118 119 |
# File 'lib/toys/templates/rdoc.rb', line 117 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.
109 110 111 |
# File 'lib/toys/templates/rdoc.rb', line 109 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.
171 172 173 |
# File 'lib/toys/templates/rdoc.rb', line 171 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.
153 154 155 |
# File 'lib/toys/templates/rdoc.rb', line 153 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".
135 136 137 |
# File 'lib/toys/templates/rdoc.rb', line 135 def markup=(value) @markup = value end |
#name=(value) ⇒ String
Name of the tool to create.
98 99 100 |
# File 'lib/toys/templates/rdoc.rb', line 98 def name=(value) @name = value end |
#options=(value) ⇒ Array<String>
Additional options to pass to RDoc
179 180 181 |
# File 'lib/toys/templates/rdoc.rb', line 179 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.
126 127 128 |
# File 'lib/toys/templates/rdoc.rb', line 126 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.
162 163 164 |
# File 'lib/toys/templates/rdoc.rb', line 162 def template=(value) @template = value end |
#title=(value) ⇒ String?
Title of RDoc documentation pages.
If set to nil
, RDoc will use a default title.
144 145 146 |
# File 'lib/toys/templates/rdoc.rb', line 144 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.
212 213 214 215 |
# File 'lib/toys/templates/rdoc.rb', line 212 def use_bundler(**opts) @bundler = opts self end |