Class: YARD::CLI::YardoptsCommand Abstract

Inherits:
Command
  • Object
show all
Defined in:
lib/yard/cli/yardopts_command.rb

Overview

This class is abstract.

Abstract base class for command that reads .yardopts file

Since:

  • 0.8.3

Direct Known Subclasses

Graph, Yardoc

Constant Summary collapse

DEFAULT_YARDOPTS_FILE =

The configuration filename to load extra options from

Since:

  • 0.8.3

".yardopts"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#description, run

Constructor Details

#initializeYardoptsCommand

Creates a new command that reads .yardopts

Since:

  • 0.8.3



25
26
27
28
29
30
# File 'lib/yard/cli/yardopts_command.rb', line 25

def initialize
  super
  @options_file = DEFAULT_YARDOPTS_FILE
  @use_yardopts_file = true
  @use_document_file = true
end

Instance Attribute Details

#options_fileString

The options file name (defaults to DEFAULT_YARDOPTS_FILE)

Returns:

  • (String)

    the filename to load extra options from

Since:

  • 0.8.3



22
23
24
# File 'lib/yard/cli/yardopts_command.rb', line 22

def options_file
  @options_file
end

#use_document_fileBoolean

Returns whether to parse options from .document.

Returns:

  • (Boolean)

    whether to parse options from .document

Since:

  • 0.8.3



18
19
20
# File 'lib/yard/cli/yardopts_command.rb', line 18

def use_document_file
  @use_document_file
end

#use_yardopts_fileBoolean

Returns whether to parse options from .yardopts.

Returns:

  • (Boolean)

    whether to parse options from .yardopts

Since:

  • 0.8.3



15
16
17
# File 'lib/yard/cli/yardopts_command.rb', line 15

def use_yardopts_file
  @use_yardopts_file
end

Instance Method Details

#parse_arguments(*args) ⇒ Boolean

Parses commandline arguments

Parameters:

Returns:

  • (Boolean)

    whether or not arguments are valid

Since:

  • 0.5.6



36
37
38
39
40
41
42
43
# File 'lib/yard/cli/yardopts_command.rb', line 36

def parse_arguments(*args)
  parse_yardopts_options(*args)

  # Parse files and then command line arguments
  parse_rdoc_document_file
  parse_yardopts
  optparse(*args)
end