aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-08-04 00:40:12 +0100
committerMax Howell2009-08-04 00:40:12 +0100
commit6e2a5d13f27670a6b451d10fd2185d33d1528f33 (patch)
treec915bae9e4d7a52b07cbc89bd0872001815d3e2e /Library
parente74d891b5bc5de06d69306598ba66457af01cbd3 (diff)
downloadhomebrew-6e2a5d13f27670a6b451d10fd2185d33d1528f33.tar.bz2
HOMEBREW_CACHE is now a Pathname object
This is consistent with the other HOMEBREW_* path constants
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/env.rb2
-rw-r--r--Library/Homebrew/formula.rb2
-rw-r--r--Library/Homebrew/hw.model.rb4
-rwxr-xr-xLibrary/Homebrew/unittest.rb4
4 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/env.rb b/Library/Homebrew/env.rb
index 3d948275e..3710aa793 100644
--- a/Library/Homebrew/env.rb
+++ b/Library/Homebrew/env.rb
@@ -20,6 +20,6 @@ require 'utils'
# TODO if whoami == root then use /Library/Caches/Homebrew instead
HOMEBREW_VERSION='0.3'
-HOMEBREW_CACHE=File.expand_path "~/Library/Caches/Homebrew"
+HOMEBREW_CACHE=Pathname.new("~/Library/Caches/Homebrew").expand_path
HOMEBREW_PREFIX=Pathname.new(__FILE__).dirname.parent.parent.cleanpath
HOMEBREW_CELLAR=HOMEBREW_PREFIX+'Cellar'
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 6a3a053c8..450ba5d13 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -96,7 +96,7 @@ public
# yields self with current working directory set to the uncompressed tarball
def brew
ohai "Downloading #{@url}"
- FileUtils.mkpath HOMEBREW_CACHE
+ HOMEBREW_CACHE.mkpath
Dir.chdir HOMEBREW_CACHE do
tmp=nil
tgz=Pathname.new(fetch()).realpath
diff --git a/Library/Homebrew/hw.model.rb b/Library/Homebrew/hw.model.rb
index a88bccb2e..a7fd8715e 100644
--- a/Library/Homebrew/hw.model.rb
+++ b/Library/Homebrew/hw.model.rb
@@ -1,7 +1,7 @@
def hw_model_output
require 'fileutils'
- FileUtils.mkpath HOMEBREW_CACHE
- exe=Pathname.new(HOMEBREW_CACHE)+'hw.model'
+ HOMEBREW_CACHE.mkpath
+ exe=HOMEBREW_CACHE+'hw.model'
Kernel.system "gcc -Os #{File.dirname __FILE__}/hw.model.c -o #{exe}" unless exe.file?
/(.*)(\d+),(\d+)/ =~ `#{exe}`
yield $1, $2.to_i, $3.to_i
diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb
index 5371ee36e..f1942434b 100755
--- a/Library/Homebrew/unittest.rb
+++ b/Library/Homebrew/unittest.rb
@@ -9,13 +9,13 @@ require 'utils'
# these are defined in env.rb usually, but we don't want to break our actual
# homebrew tree, and we do want to test everything :)
HOMEBREW_VERSION='0.3t'
-HOMEBREW_CACHE="/tmp/testbrew"
+HOMEBREW_CACHE=Pathname.new "/tmp/testbrew"
HOMEBREW_PREFIX=Pathname.new(HOMEBREW_CACHE)+'prefix'
HOMEBREW_CELLAR=Pathname.new(HOMEBREW_CACHE)+'cellar'
HOMEBREW_CELLAR.mkpath
raise "HOMEBREW_CELLAR couldn't be created!" unless HOMEBREW_CELLAR.directory?
-at_exit { Pathname.new(HOMEBREW_CACHE).rmtree }
+at_exit { HOMEBREW_CACHE.rmtree }
require 'test/unit' # must be after at_exit