Skip to main content

Chef/Deprecations/UseYamlDump

Cookstyle cops page

The Cookstyle cops department: Chef/Deprecations

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

Chef Infra Client 16.5 introduced performance enhancements to Ruby library loading. Due to the underlying implementation of Ruby’s .to_yaml method, it does not automatically load the yaml library and YAML.dump() should be used instead to properly load the yaml library.

Examples

incorrect

{"foo" => "bar"}.to_yaml

correct

YAML.dump({"foo" => "bar"})

Configurable attributes

NameDefault valueConfigurable values
Version Added6.21.0String
Include
    Array

    Thank you for your feedback!

    ×