Sha256: 78eb9d69b47a3c8d36759c19ee35ad71d34997d2f93305ec7fd3147b4f3c6523

Contents?: true

Size: 547 Bytes

Versions: 14

Compression:

Stored size: 547 Bytes

Contents

module Puppet::Parser::Functions
  newfunction(:mysql_strip_hash, :type => :rvalue, :arity => 1, :doc => <<-EOS
TEMPORARY FUNCTION: EXPIRES 2014-03-10
When given a hash this function strips out all blank entries.
EOS
  ) do |args|

    hash = args[0]
    unless hash.is_a?(Hash)
      raise(Puppet::ParseError, 'mysql_strip_hash(): Requires hash to work with')
    end

    # Filter out all the top level blanks.
    hash.reject{|k,v| v == ''}.each do |k,v|
      if v.is_a?(Hash)
        v.reject!{|ki,vi| vi == '' }
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.6.0 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.5.2 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.5.1 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.5.0 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.4.1 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.4.0 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.3.3 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.3.2 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.3.1 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.3.0 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.2.1 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.2.0 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb
freighthop-0.1.0 modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb