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.

parse

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

2015-05-03 10:39:48
write_options

write_options() Instance Public methods Writes the YAML file .rdoc_options to

2015-05-03 11:09:51
generator_descriptions

generator_descriptions() Instance Public methods Returns a properly-space list

2015-05-03 10:37:59
sanitize_path

sanitize_path(path) Instance Public methods Removes directories from path

2015-05-03 10:51:17