aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2010-09-12 21:52:30 +0100
committerMax Howell2010-09-12 21:57:17 +0100
commitf493853179ca03dc23cc1970a7b66797cc2ab181 (patch)
tree46450c49762ba92be19b4b612888a3582331666a /Library
parent55d98846d8a3938adf1ea5c0d8ddfcdf4facfb06 (diff)
downloadhomebrew-f493853179ca03dc23cc1970a7b66797cc2ab181.tar.bz2
Pathname./ because it looks a lot better than +
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/pathname.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 0a4264c7e..8d81861ec 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -209,20 +209,26 @@ class Pathname
self.to_s[0, prefix.length] == prefix
end
+ # perhaps confusingly, this Pathname object becomes the symlink pointing to
+ # the src paramter.
def make_relative_symlink src
self.dirname.mkpath
Dir.chdir self.dirname do
# TODO use Ruby function so we get exceptions
# NOTE Ruby functions may work, but I had a lot of problems
- rv=system 'ln', '-sf', src.relative_path_from(self.dirname)
+ rv = system 'ln', '-sf', src.relative_path_from(self.dirname)
unless rv and $? == 0
- raise <<-EOS
-Could not create symlink #{to_s}.
-Check that you have permssions on #{self.dirname}
- EOS
+ raise <<-EOS.undent
+ Could not create symlink #{to_s}.
+ Check that you have permssions on #{self.dirname}
+ EOS
end
end
end
+
+ def / that
+ join that.to_s
+ end
end
# sets $n and $d so you can observe creation of stuff