Mercurial > repos > other > Puppet
view modules/website/lib/puppet/parser/functions/hash_to_csp.rb @ 237:1e65604c182a puppet-3.6
Add missing custom function
Forgot to "hg add" it
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Fri, 20 Dec 2019 09:41:34 +0000 |
parents | |
children |
line wrap: on
line source
module Puppet::Parser::Functions newfunction(:hash_to_csp, :type => :rvalue) do |args| csp_defaults = args[0] csp_overrides = args[1] csp_combined = csp_defaults.merge(csp_overrides == "" ? {} : csp_overrides) csp_string = csp_combined.map { |index, value| "#{index} #{value}" }.join ("; ") end end