diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-13 06:31:02 -0800 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2015-02-17 09:24:45 -0500 |
commit | c2438711405a34d74c9e9c145edf90ece094a423 (patch) | |
tree | 9d4cf57a1cb4107e2209534b015c91b61bc10452 | |
parent | c020ea0c2a84ff532bdbf55dac3eab34189ede8e (diff) | |
download | chef-c2438711405a34d74c9e9c145edf90ece094a423.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 |