aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-07-25 12:07:35 -0700
committerAdam Vandenberg2010-07-25 12:07:35 -0700
commit64e026a550963365a5de85b2f1109530362147ae (patch)
treecb9af90735c67c20f60126576a7e0bf10193fcb4 /Library
parent1222f403f9d71ba4af2cce7ffd0d0a92102f261e (diff)
downloadhomebrew-64e026a550963365a5de85b2f1109530362147ae.tar.bz2
Add Pathname.resolved_path
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/pathname.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 0b1c27806..93a1f08cc 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -196,6 +196,10 @@ class Pathname
children.select{ |child| child.directory? }
end
+ def resolved_path
+ self.symlink? ? dirname+readlink : self
+ end
+
def resolved_path_exists?
(dirname+readlink).exist?
end