Extend with a module instead of aliasing on the singleton class

This commit is contained in:
Jack Nagel 2014-07-06 22:05:53 -05:00
parent dd3446ded1
commit d5a01de8e3

View File

@ -26,17 +26,14 @@ def cache
if home_cache.directory? and home_cache.writable_real?
home_cache
else
root_cache = Pathname.new("/Library/Caches/Homebrew")
class << root_cache
alias :oldmkpath :mkpath
Pathname.new("/Library/Caches/Homebrew").extend Module.new {
def mkpath
unless exist?
oldmkpath
super
chmod 0777
end
end
end
root_cache
}
end
end
end