Method: Puppet::Provider::Package#join_options

Defined in:
lib/puppet/provider/package.rb

#join_options(options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Turns a array of options into flags to be passed to a command. The options can be passed as a string or hash. Note that passing a hash should only be used in case –foo=bar must be passed, which can be accomplished with:

install_options => [ { '--foo' => 'bar' } ]

Regular flags like ‘–foo’ must be passed as a string.

Parameters:

Returns:

  • Concatenated list of options

API:

  • private



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/puppet/provider/package.rb', line 42

def join_options(options)
  return unless options

  options.collect do |val|
    case val
      when Hash
        val.keys.sort.collect do |k|
          "#{k}=#{val[k]}"
        end
      else
        val
    end
  end.flatten
end