Module: RubiGen::Options

Module | RubiGen::Options
In: | lib/rubigen/options.rb

### Methods

add_general_options! add_options! banner default_options full_options included mandatory_options options parse! usage usage_message

### Classes and Modules

Module RubiGen::Options::ClassMethods

### Attributes

options | [W] |

### Public Class methods

included(base)

### Public Instance methods

options()

Each instance has an options hash that‘s populated by parse.

### Protected Instance methods

add_general_options!(opt)

Adds general options like -h and —quiet. Usually don‘t override.

add_options!(opt)

Override to add your options to the parser:

      def add_options!(opt)
        opt.on('-v', '--verbose') { |value| options[:verbose] = value }
      end

banner()

Override with your own usage banner.

default_options()

Convenient access to class default options.

full_options(runtime_options = {})

Merge together our instance options. In increasing precedence:

      default_options   (class default options)
      options           (instance options)
      runtime_options   (provided as argument)
      mandatory_options (class mandatory options)

mandatory_options()

Convenient access to class mandatory options.

parse!(args, runtime_options = {})

Parse arguments into the options hash. Classes may customize parsing behavior by overriding these methods:

      #banner                 Usage: ./script/generate [options]
      #add_options!           Options:
                                some options..
      #add_general_options!   General Options:
                                general options..

usage(message = usage_message)

Raise a usage error. Override usage_message to provide a blurb after the option parser summary.

usage_message()

[Validate]