From 40115a8debbf739ada4087115d0fabc4e6e64426 Mon Sep 17 00:00:00 2001 From: danielsdeleo Date: Fri, 4 Jan 2013 16:41:37 -0800 Subject: Fix dynamic inclusion of windows securable behavior --- lib/chef/mixin/securable.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/chef/mixin/securable.rb') diff --git a/lib/chef/mixin/securable.rb b/lib/chef/mixin/securable.rb index 4ab343df8f..f77703f21a 100644 --- a/lib/chef/mixin/securable.rb +++ b/lib/chef/mixin/securable.rb @@ -171,21 +171,10 @@ class Chef end #==WindowsSecurableAttributes - # Defines methods #rights, #deny_rights, and #inherits to describe - # Windows file security ACLs on the including class. The including class - # is also extended with WindowsMacros, so more rights attributes may be - # defined. + # Defines #inherits to describe Windows file security ACLs on the + # including class module WindowsSecurableAttributes - # Callback that fires when included; will extend the including class - # with WindowsMacros and define #rights and #deny_rights on it. - def self.included(including_class) - including_class.extend(WindowsMacros) - - # create a default 'rights' attribute - including_class.rights_attribute(:rights) - including_class.rights_attribute(:deny_rights) - end def inherits(arg=nil) set_or_return( @@ -198,7 +187,18 @@ class Chef if RUBY_PLATFORM =~ /mswin|mingw|windows/ include WindowsSecurableAttributes - end # Windows-specific + end + + # Callback that fires when included; will extend the including class + # with WindowsMacros and define #rights and #deny_rights on it. + def self.included(including_class) + if RUBY_PLATFORM =~ /mswin|mingw|windows/ + including_class.extend(WindowsMacros) + # create a default 'rights' attribute + including_class.rights_attribute(:rights) + including_class.rights_attribute(:deny_rights) + end + end end end -- cgit v1.2.1