Add TapDependency

This commit is contained in:
Jack Nagel 2014-02-28 11:16:55 -06:00
parent 369f9b3251
commit c6bc01ab58
3 changed files with 16 additions and 0 deletions

View File

@ -131,3 +131,15 @@ class Dependency
end end
end end
end end
class TapDependency < Dependency
def initialize(name, tags=[], env_proc=DEFAULT_ENV_PROC, option_name=name)
super(name, tags, env_proc, name.split("/").last)
end
def installed?
super
rescue FormulaUnavailableError
false
end
end

View File

@ -89,6 +89,8 @@ class DependencyCollector
Dependency.new(spec, tags) Dependency.new(spec, tags)
elsif (tag = tags.first) && LANGUAGE_MODULES.include?(tag) elsif (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
LanguageModuleDependency.new(tag, spec) LanguageModuleDependency.new(tag, spec)
elsif HOMEBREW_TAP_FORMULA_REGEX === spec
TapDependency.new(spec, tags)
else else
Dependency.new(spec, tags) Dependency.new(spec, tags)
end end

View File

@ -27,6 +27,8 @@ HOMEBREW_WWW = 'http://example.com'
HOMEBREW_CURL_ARGS = '-fsLA' HOMEBREW_CURL_ARGS = '-fsLA'
HOMEBREW_VERSION = '0.9-test' HOMEBREW_VERSION = '0.9-test'
HOMEBREW_TAP_FORMULA_REGEX = %r{^(\w+)/(\w+)/([^/]+)$}
RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir']) RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT'] RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']