- Depend on compat_resource
- Descend resources from ChefCompat::Resource
- Set resource_name in the class instead of the constructor
- Convert Attributes to Properties
- Rename attribute -> property
- Move set_or_return -> property
- Take kind_of/equal_to/regexes and make them types
- Use true/false/nil instead of TrueClass/FalseClass/NilClass
- Remove default: nil (it's the default)
- Convert Top-Level Providers to Actions
- Create any resources that don't already exist (for example in multi-provider cases) and descend from the base resource
- Remove allowed_actions / @actions
- @action -> default_action
- Move
provides
andaction :x
to the resource - Remove use_inline_resources and def whyrun_safe?
- Move other methods to
action_class.class_eval do
Now you have everything in a resource, are using properties, and have gotten rid of a bunch of boilerplate. Of course, this is just getting it moved.
- Resource Inheritance
- Resources That Are Different On Each OS?
- Coercion: Handling User Input
- Lazy Defaults
- Using Load Current Resource
- Using Converge If Changed
- Defaults Are For Creation
- Shared types: using a type multiple places