aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-01-23 00:26:24 -0600
committerJack Nagel2013-01-26 12:14:44 -0600
commitf180a4f7dcd80e0d14cf26c456c1f0992653c8d3 (patch)
tree901a7451d7691ce809e5d84501c27ef23739c234 /Library
parente95cebc1469fafaa87c807b75265f1b9a2b4fd43 (diff)
downloadhomebrew-f180a4f7dcd80e0d14cf26c456c1f0992653c8d3.tar.bz2
Dependency#to_formula and associated helpers
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dependencies.rb8
-rw-r--r--Library/Homebrew/formula.rb4
2 files changed, 8 insertions, 4 deletions
diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb
index b519de111..dd51a2131 100644
--- a/Library/Homebrew/dependencies.rb
+++ b/Library/Homebrew/dependencies.rb
@@ -169,6 +169,14 @@ class Dependency
def hash
name.hash
end
+
+ def to_formula
+ Formula.factory(name)
+ end
+
+ def requested?
+ ARGV.formulae.include?(to_formula) rescue false
+ end
end
# A base class for non-formula requirements needed by formulae.
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 453a06ef7..2e072afff 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -77,10 +77,6 @@ class Formula
installed_prefix.children.length > 0 rescue false
end
- def explicitly_requested?
- ARGV.formulae.include?(self) rescue false
- end
-
def linked_keg
HOMEBREW_REPOSITORY/'Library/LinkedKegs'/@name
end