lib/bolt/pal/yaml_plan.rb
# Turn all "potential" strings in the object into actual strings.
# Because we interpret bare strings as potential Puppet code, even in
# places where Puppet code isn't allowed (like some hash keys), we need
# to be able to force them back into regular strings, as if we had
# parsed them normally.
Turn all "potential" strings in the object into actual strings.
Because we interpret bare strings as potential Puppet code, even in
places where Puppet code isn't allowed (like some hash keys), we need
to be able to force them back into regular strings, as if we had
parsed them normally.
Turn all " potential " strings in the object into actual strings . Because we interpret bare strings as potential Puppet code even in places where Puppet code isn ' t allowed ( like some hash keys ) we need to be able to force them back into regular strings as if we had parsed them normally .
def stringify(value)
        case value
        when Array
          value.map { |element| stringify(element) }
        when Hash
          value.each_with_object({}) do |(k, v), o|
            o[stringify(k)] = stringify(v)
          end
        when EvaluableString
          value.value
        else
          value
        end
      end
def stringify ( value ) case value when Array value . map { | element | stringify ( element ) } when Hash value . each_with_object ( { } ) do | ( k , v ) , o | o [ stringify ( k ) ] = stringify ( v ) end when EvaluableString value . value else value end end
Turn all "potential" strings in the object into actual strings.
Turn all " potential " strings in the object into actual strings .
value
<not_specific>