summaryrefslogtreecommitdiff
path: root/lib/chef/mixin/properties.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-03-24 08:02:19 +0000
committerThom May <thom@chef.io>2018-03-24 08:02:19 +0000
commit3a2fd533ddd386440cb5307cf9585922f31452d7 (patch)
treecd3f2e2cdaa9bb238a2cca2c350d5ff8cf35c421 /lib/chef/mixin/properties.rb
parentb8d6fac0280d165aee24c40e171d921fb10deb63 (diff)
downloadchef-3a2fd533ddd386440cb5307cf9585922f31452d7.tar.gz
RFC-102: Deprecation warning in resourcestm/deprecated_properties
* `deprecated_property_alias` allows the resource author to provide transition from old properties to new ones with a deprecation warning. * The `deprecated` option on a property emits a deprecation warning. * The `deprecated` method on a resource takes a message, but does not yet emit a deprecation warning. Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/mixin/properties.rb')
-rw-r--r--lib/chef/mixin/properties.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/mixin/properties.rb b/lib/chef/mixin/properties.rb
index 6b95b87063..fb765fbb3a 100644
--- a/lib/chef/mixin/properties.rb
+++ b/lib/chef/mixin/properties.rb
@@ -149,6 +149,10 @@ class Chef
Property.derive(**options)
end
+ def deprecated_property_alias(from, to, message)
+ Property.emit_deprecated_alias(from, to, message, self)
+ end
+
#
# Create a lazy value for assignment to a default value.
#