diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-13 06:31:02 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-13 06:31:02 -0800 |
commit | 3e675e104c5b14479f62ab2b4c7355814a9f2975 (patch) | |
tree | 9b164485124c6d4f0fde44dc43c78fbb2a1eb00c | |
parent | 2914678086460ceb559bb86fe1ba1f6950122148 (diff) | |
download | chef-3e675e104c5b14479f62ab2b4c7355814a9f2975.tar.gz |
Added comments about class methods
-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 |