Class: R10K::Action::Base

Inherits:
Object
  • Object
show all
Includes:
Logging, Util::Setopts
Defined in:
lib/r10k/action/base.rb

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

debug_formatter, default_formatter, default_outputter, #logger, #logger_name, parse_level

Constructor Details

#initialize(opts, argv, settings = {}) ⇒ Base

Note:

All arguments will be required in the next major version

Returns a new instance of Base.

Parameters:

  • opts (Hash)

    A hash of options defined in #allowed_initialized_opts and managed by the SetOps mixin within the Action::Base class. Corresponds to the CLI flags and options.

  • argv (Enumerable)

    Typically CRI::ArgumentList or Array. A list-like collection of the remaining arguments to the CLI invocation (after removing flags and options).

  • settings (Hash) (defaults to: {})

    A hash of configuration loaded from the relevant config (r10k.yaml).



23
24
25
26
27
28
29
# File 'lib/r10k/action/base.rb', line 23

def initialize(opts, argv, settings = {})
  @opts = opts
  @argv = argv
  @settings = settings

  setopts(opts, allowed_initialize_opts)
end

Instance Attribute Details

#settingsObject

Returns the value of attribute settings.



11
12
13
# File 'lib/r10k/action/base.rb', line 11

def settings
  @settings
end