Method: PDK::Util::PuppetStrings.puppet

Defined in:
lib/pdk/util/puppet_strings.rb

.puppet(*args) ⇒ Hash{Symbol=>Object}

Runs Puppet for the purposes of generating puppet-strings output.

Parameters:

  • *args (String)

    additional parameters to pass to puppet.

Returns:

  • (Hash{Symbol=>Object})

    the result of the command execution.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/pdk/util/puppet_strings.rb', line 15

def self.puppet(*args)
  require 'pdk/cli/exec/command'

  PDK::Util::Bundler.ensure_binstubs!('puppet')

  argv = [File.join(PDK::Util.module_root, 'bin', 'puppet')] + args
  argv.unshift(File.join(PDK::Util::RubyVersion.bin_path, 'ruby.exe')) if Gem.win_platform?

  command = PDK::CLI::Exec::Command.new(*argv).tap do |c|
    c.context = :module
    c.add_spinner('Examining module contents')
  end

  command.execute!
end