diff options
author | danielsdeleo <dan@opscode.com> | 2013-01-04 16:41:37 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-01-04 16:41:37 -0800 |
commit | 40115a8debbf739ada4087115d0fabc4e6e64426 (patch) | |
tree | fe0c24bbbc3136960f98a19241eec22296fdafec /lib/chef/mixin/securable.rb | |
parent | e0f3a2c5051256659ec0663517be791abaaa28ac (diff) | |
download | chef-40115a8debbf739ada4087115d0fabc4e6e64426.tar.gz |
Fix dynamic inclusion of windows securable behavior
Diffstat (limited to 'lib/chef/mixin/securable.rb')
-rw-r--r-- | lib/chef/mixin/securable.rb | 28 |
1 files changed, 14 insertions, 14 deletions
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 |