Class: R10K::Source::Exec

Inherits:
Hash show all
Defined in:
lib/r10k/source/exec.rb

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS

Instance Attribute Summary

Attributes inherited from Base

#basedir, #name, #prefix, #puppetfile_name

Instance Method Summary collapse

Methods inherited from Hash

#desired_contents, #environments, #set_environments_hash, valid_environments_hash?

Methods inherited from Base

#accept, #environments, #preload!, #reload!

Methods included from Logging

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

Constructor Details

#initialize(name, basedir, options = {}) ⇒ Exec

Returns a new instance of Exec.



8
9
10
11
12
13
14
15
16
# File 'lib/r10k/source/exec.rb', line 8

def initialize(name, basedir, options = {})
  unless @command = options[:command]
    raise ConfigError, _('Environment source %{name} missing required parameter: command') % {name: name}
  end

  # We haven't set the environments option yet. We will do that by
  # overloading the #environments method.
  super(name, basedir, options)
end

Instance Method Details

#environments_hashObject



18
19
20
# File 'lib/r10k/source/exec.rb', line 18

def environments_hash
  @environments_hash ||= set_environments_hash(run_environments_command)
end