aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-06-23 22:52:41 -0500
committerJack Nagel2014-06-23 22:55:23 -0500
commitea82d1847dd0ab3fbae34c6ecc133846bfcd6984 (patch)
tree7b3fc1268cd3f0499678e8d9edaba65ae8817073 /Library
parent2db80ae3bbe22e328504c0ae991a865658abbbdf (diff)
downloadhomebrew-ea82d1847dd0ab3fbae34c6ecc133846bfcd6984.tar.bz2
Initialize linked_keg_record in the Keg constructor
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index deb22402b..e8043a8f3 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -88,10 +88,13 @@ class Keg < Pathname
raise NotAKegError, "#{path} is not inside a keg"
end
+ attr_reader :linked_keg_record
+
def initialize path
super path
raise "#{to_s} is not a valid keg" unless parent.parent.realpath == HOMEBREW_CELLAR.realpath
raise "#{to_s} is not a directory" unless directory?
+ @linked_keg_record = HOMEBREW_LIBRARY.join("LinkedKegs", fname)
end
def uninstall
@@ -145,10 +148,6 @@ class Keg < Pathname
FormulaLock.new(fname).with_lock { yield }
end
- def linked_keg_record
- @linked_keg_record ||= HOMEBREW_REPOSITORY/"Library/LinkedKegs"/fname
- end
-
def linked?
linked_keg_record.directory? && self == linked_keg_record.resolved_path
end