Sha256: 7da77c98add4109351014155f1be7f1ed2686a4f7ca2b11e601243eebe311870
Contents?: true
Size: 576 Bytes
Versions: 11
Compression:
Stored size: 576 Bytes
Contents
require 'puppet/parameter' class Puppet::Parameter::PackageOptions < Puppet::Parameter def unsafe_munge(values) values = [values] unless values.is_a? Array values.collect do |val| case val when Hash safe_hash = {} val.each_pair do |k, v| safe_hash[quote(k)] = quote(v) end safe_hash when String quote(val) else fail("Expected either a string or hash of options") end end end def quote(value) value.include?(' ') ? %Q["#{value.gsub(/"/, '\"')}"] : value end end
Version data entries
11 entries across 11 versions & 1 rubygems