diff options
| author | Adam Vandenberg | 2012-02-28 19:56:35 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-03-10 09:24:10 -0800 |
| commit | cef5429f9373526ed1fe523bcbbbb42b5cf65ea9 (patch) | |
| tree | f5c0965e9288ef1bb36be60872cdd167a0fc2186 /Library/Homebrew/exceptions.rb | |
| parent | fee00469f61e14e7dd9503a7b3381a95eb49ad81 (diff) | |
| download | brew-cef5429f9373526ed1fe523bcbbbb42b5cf65ea9.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 |
