From d5a01de8e3773ffa56f792d03b37c53da755a2e8 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 6 Jul 2014 22:05:53 -0500 Subject: [PATCH] Extend with a module instead of aliasing on the singleton class --- Library/Homebrew/global.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index c7c6d66813..9e3af1ee8d 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -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