diff options
| author | Adam Vandenberg | 2012-02-28 19:56:35 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-03-10 09:24:10 -0800 |
| commit | d5f0cb3c0782d0893ca8397d4f7d8b5781dee9cd (patch) | |
| tree | 7ea9b0b2c51f9963c3efc6168312a927b684352c /Library/Homebrew/exceptions.rb | |
| parent | 2d021267d9d9ad5d5ef552e02ffae2d47e2e4891 (diff) | |
| download | homebrew-d5f0cb3c0782d0893ca8397d4f7d8b5781dee9cd.tar.bz2 | |
Use new Requirements code in Homebrew
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 52 |
1 files changed, 5 insertions, 47 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index df334582c..fd425cfc1 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -51,54 +51,12 @@ class FormulaInstallationAlreadyAttemptedError < Homebrew::InstallationError end end -class UnsatisfiedExternalDependencyError < Homebrew::InstallationError - attr :type +class UnsatisfiedRequirement < Homebrew::InstallationError + attr :dep - def initialize formula, type - @type = type - super formula, get_message(formula) - end - - def get_message formula - <<-EOS.undent - Unsatisfied external dependency: #{formula} - Homebrew does not provide #{type.to_s.capitalize} dependencies, #{tool} does: - #{command_line} #{formula} - EOS - end - - private - - def tool - case type - when :python then 'easy_install' - when :ruby, :jruby, :rbx then 'rubygems' - when :perl then 'cpan' - when :node then 'npm' - when :chicken then 'chicken-install' - when :lua then "luarocks" - end - end - - def command_line - case type - when :python - "easy_install" - when :ruby - "gem install" - when :perl - "cpan -i" - when :jruby - "jruby -S gem install" - when :rbx - "rbx gem install" - when :node - "npm install" - when :chicken - "chicken-install" - when :lua - "luarocks install" - end + def initialize formula, dep + @dep = dep + super formula, "An unsatisfied requirement failed this build." end end |
