Module BareTest::Formatter
In: lib/baretest/formatter.rb

Extend Formatters that have custom options with this module to gain convenience methods to define the custom options. See Command‘s documentation for more information.

Methods

Attributes

command  [R]  Provides access to the command/options/arguments related information.

Public Instance methods

Use an env-variable and map it to an option. Example:

  env_option :indent, "INDENT"

[Source]

    # File lib/baretest/formatter.rb, line 48
48:     def env_option(*args)
49:       @command[:elements] << [:env_option, args]
50:     end

Define a formatter-specific option. See Command::Definition#option

[Source]

    # File lib/baretest/formatter.rb, line 54
54:     def option(*args)
55:       @command[:elements] << [:option, args]
56:     end

Define default values for options. Example:

  option_defaults :colors => false,
                  :indent => 3

[Source]

    # File lib/baretest/formatter.rb, line 36
36:     def option_defaults(defaults={})
37:       @command[:option_defaults].update(defaults)
38:     end

Inject a piece of text into the helptext.

[Source]

    # File lib/baretest/formatter.rb, line 41
41:     def text(*args)
42:       @command[:elements] << [:text, args]
43:     end

[Validate]