diff options
-rw-r--r-- | lib/chef/file_access_control/unix.rb | 2 | ||||
-rw-r--r-- | lib/chef/file_access_control/windows.rb | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/file_access_control/unix.rb b/lib/chef/file_access_control/unix.rb index 81ca6fe281..472f30b752 100644 --- a/lib/chef/file_access_control/unix.rb +++ b/lib/chef/file_access_control/unix.rb @@ -27,12 +27,14 @@ class Chef UID_MAX = (1 << 32) - 10 module ClassMethods + # We want to mix these in as class methods def writable?(path) ::File.writable?(path) end end def self.included(base) + # When this file is mixed in, make sure we also add the class methods base.send :extend, ClassMethods end diff --git a/lib/chef/file_access_control/windows.rb b/lib/chef/file_access_control/windows.rb index 2f0e2c709a..1781a6fa63 100644 --- a/lib/chef/file_access_control/windows.rb +++ b/lib/chef/file_access_control/windows.rb @@ -31,6 +31,7 @@ class Chef SID = Security::SID module ClassMethods + # We want to mix these in as class methods def writable?(path) ::File.exists?(path) && Chef::ReservedNames::Win32::File.file_access_check( path, Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE) @@ -38,6 +39,7 @@ class Chef end def self.included(base) + # When this file is mixed in, make sure we also add the class methods base.send :extend, ClassMethods end |