Skip to main content

UseYamlDump

All Cookstyle Cops


The department is: Chef/Deprecations

The full name of the cop is: Chef/Deprecations/UseYamlDump


Enabled by default Supports autocorrection Target Chef Version
Enabled Yes All 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

Name Default value Configurable values
Version Added 6.21.0 String
Array

Was this page helpful?

×









Search Results