Chef/Ruby/UnlessDefinedRequire
The Cookstyle cops department: Chef/Ruby
Enabled by default | Supports autocorrection | Target Chef Version |
---|---|---|
Not Enabled | Yes | All Versions |
Rubygems is VERY slow to require gems even if they’ve already been loaded. To work around this
wrap your require statement with an if defined?()
check.
Examples
Configurable attributes
Name | Default value | Configurable values |
---|---|---|
Version Added | String | |
Include | Array |