aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2013-01-26 14:33:03 +0000
committerMike McQuaid2013-01-26 14:33:05 +0000
commita3daca1b132d072070fd35236da6ce32ffc973b7 (patch)
treefe62ca29a979bbf5f41b897cae117ed1fae09b26 /Library
parentff4baa3fcc7e6f6c1afd5e433c71f9dd07ac076b (diff)
downloadbrew-a3daca1b132d072070fd35236da6ce32ffc973b7.tar.bz2
Allow depending on requirement class or instance.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dependencies.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb
index 4a4cd6d91..b519de111 100644
--- a/Library/Homebrew/dependencies.rb
+++ b/Library/Homebrew/dependencies.rb
@@ -54,6 +54,12 @@ private
Dependency.new(spec.name, tag)
when Dependency, Requirement
spec
+ when Class
+ if spec < Requirement
+ spec.new
+ else
+ raise "#{spec} is not a Requirement subclass"
+ end
else
raise "Unsupported type #{spec.class} for #{spec}"
end