Type:
Class
Constants:
DEPRECATED : { '--accessor' => 'support discontinued', '--diagram' => 'support discontinued', '--help-output' => 'support discontinued', '--image-format' => 'was an option for --diagram', '--inline-source' => 'source code is now always inlined', '--merge' => 'ri now always merges class information', '--one-file' => 'support discontinued', '--op-name' => 'support discontinued', '--opname' => 'support discontinued', '--promiscuous' => 'files always only document their content', '--ri-system' => 'Ruby installers use other techniques', }

The deprecated options.

SPECIAL : %w[ coverage_report dry_run encoding files force_output force_update generator generator_name generator_options generators op_dir option_parser pipe rdoc_include root static_path stylesheet_url template template_dir update_output_dir verbosity write_options ]

RDoc options ignored (or handled specially) by âwrite-options

Directory : Object.new

Option validator for OptionParser that matches a directory that exists on the filesystem.

Path : Object.new

Option validator for OptionParser that matches a file or directory that exists on the filesystem.

PathArray : Object.new

Option validator for OptionParser that matches a comma-separated list of files or directories that exist on the filesystem.

Template : Object.new

Option validator for OptionParser that matches a template directory for an installed generator that lives in "rdoc/generator/template/#{template_name}"

RDoc::Options handles the parsing and storage of options

Saved Options

You can save some options like the markup format in the .rdoc_options file in your gem. The easiest way to do this is:

rdoc --markup tomdoc --write-options

Which will automatically create the file and fill it with the options you specified.

The following options will not be saved since they interfere with the user's preferences or with the normal operation of RDoc:

  • --coverage-report

  • --dry-run

  • --encoding

  • --force-update

  • --format

  • --pipe

  • --quiet

  • --template

  • --verbose

Custom Options

Generators can hook into RDoc::Options to add generator-specific command line options.

When --format is encountered in ARGV, RDoc calls ::setup_options on the generator class to add extra options to the option parser. Options for custom generators must occur after --format. rdoc --help will list options for all installed generators.

Example:

class RDoc::Generator::Spellcheck
  RDoc::RDoc.add_generator self

  def self.setup_options rdoc_options
    op = rdoc_options.option_parser

    op.on('--spell-dictionary DICTIONARY',
          RDoc::Options::Path) do |dictionary|
      rdoc_options.spell_dictionary = dictionary
    end
  end
end

Option Validators

OptionParser validators will validate and cast user input values. In addition to the validators that ship with OptionParser (String, Integer, Float, TrueClass, FalseClass, Array, Regexp, Date, Time, URI, etc.), RDoc::Options adds Path, PathArray and Template.

default_title=

default_title=(string) Instance Public methods

2015-05-03 10:25:10
template_dir_for

template_dir_for(template) Instance Public methods Finds the template dir for

2015-05-03 11:00:44
quiet

quiet() Instance Public methods Don't display progress as we process the files

2015-05-03 10:45:57
warn

warn(message) Instance Public methods Displays a warning using

2015-05-03 11:06:08
check_files

check_files() Instance Public methods Check that the files on the command line

2015-05-03 10:14:55
finish

finish() Instance Public methods Completes any unfinished option setup business

2015-05-03 10:29:02
setup_generator

setup_generator(generator_name = @generator_name) Instance Public methods

2015-05-03 10:56:49
check_generator

check_generator() Instance Public methods Ensure only one generator is loaded

2015-05-03 10:19:35
quiet=

quiet=(bool) Instance Public methods

2015-05-03 10:48:52
parse

parse(argv) Instance Public methods Parses command line options.

2015-05-03 10:39:48