summaryrefslogtreecommitdiff
path: root/DOC_CHANGES.md
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-05-28 11:32:10 -0700
committerJohn Keiser <john@johnkeiser.com>2015-06-01 08:02:05 -0700
commit46e3f2258b1b04ca6030b5ef1575adadaa920e08 (patch)
treef59066b287aee399b923de9346be4a42f4e20924 /DOC_CHANGES.md
parent5998cc7315507e649bb76f139c07715f6e590707 (diff)
downloadchef-46e3f2258b1b04ca6030b5ef1575adadaa920e08.tar.gz
Add use_automatic_resource_name
Diffstat (limited to 'DOC_CHANGES.md')
-rw-r--r--DOC_CHANGES.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md
index 629ff147c2..b5eb124f26 100644
--- a/DOC_CHANGES.md
+++ b/DOC_CHANGES.md
@@ -14,12 +14,16 @@ automatically. Instead, `resource_name` is required in order to have DSL:
```ruby
module MyModule
class MyResource < Chef::Resource
- resource_name :my_resource
- provides :some_other_name, os: 'linux' # A second resource DSL, only on linux
+ use_automatic_resource_name # Names the resource "my_resource"
end
end
```
+`resource_name :my_resource` may be used to explicitly set the resource name.
+
+`provides :my_resource`, still works, but at least one resource_name *must* be
+set for the resource to work.
+
Authors of HWRPs need to be aware that in the future all resources and providers will be required to include a provides line. Starting with Chef 12.4.0 any HWRPs in the `Chef::Resource` or `Chef::Provider` namespaces that do not have provides lines will trigger deprecation warning messages when called. The LWRPBase code does `provides` automatically so LWRP authors and users who write classes that inherit from LWRPBase do not need to explicitly include provides lines.
Users are encouraged to declare resources in their own namespaces instead of putting them in the special `Chef::Resource` namespace.