From cef5429f9373526ed1fe523bcbbbb42b5cf65ea9 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Tue, 28 Feb 2012 19:56:35 -0800 Subject: Use new Requirements code in Homebrew --- Library/Homebrew/exceptions.rb | 52 ++++-------------------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) (limited to 'Library/Homebrew/exceptions.rb') 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 -- cgit v1.2.3