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
commitafcb3d062f2a33f7cb1573829711049031a86430 (patch)
tree8b5ca08f93769f050f28bff9c1b1ecc357c4542d /Library
parent8cc8b467099c463f9a87ee94d941af418583df0f (diff)
downloadhomebrew-afcb3d062f2a33f7cb1573829711049031a86430.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