module Chef::DSL::RenderHelpers
Public Instance Methods
Source
# File lib/chef/dsl/render_helpers.rb, line 25 def render_json(hash) JSON.pretty_generate(hash) + "\n" end
pretty-print a hash as a JSON string
Source
# File lib/chef/dsl/render_helpers.rb, line 30 def render_toml(hash) Chef::DSL::Toml::Dumper.new(hash).toml_str end
pretty-print a hash as a TOML string
Source
# File lib/chef/dsl/render_helpers.rb, line 35 def render_yaml(hash) yaml_content = hash.transform_keys(&:to_s).to_yaml # above replaces first-level keys with strings, below the rest yaml_content.gsub!(" :", " ") end
pretty-print a hash as a YAML string