aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-08-22 22:36:58 -0500
committerJack Nagel2014-08-22 22:37:35 -0500
commit262a503b6f0080f413a4dca72384e00b6a83f602 (patch)
treece65ebde286bea4a615b9dc9ff885cfd3268cf1f /Library/Homebrew
parent3d26b7584721c485d4c9df38fc7e2130c28ef75f (diff)
downloadbrew-262a503b6f0080f413a4dca72384e00b6a83f602.tar.bz2
Decouple IncompatibleCxxStdlibs from its superclass
This exception is never used outside of the CxxStdlib class, so we don't need the Homebrew::InstallationError superclass.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cxxstdlib.rb13
-rw-r--r--Library/Homebrew/exceptions.rb9
2 files changed, 11 insertions, 11 deletions
diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb
index 859c1aabb..7c3beafc8 100644
--- a/Library/Homebrew/cxxstdlib.rb
+++ b/Library/Homebrew/cxxstdlib.rb
@@ -3,6 +3,15 @@ require "compilers"
class CxxStdlib
include CompilerConstants
+ class CompatibilityError < StandardError
+ def initialize(formula, dep, stdlib)
+ super <<-EOS.undent
+ #{formula.name} dependency #{dep.name} was built with a different C++ standard
+ library (#{stdlib.type_string} from #{stdlib.compiler}). This may cause problems at runtime.
+ EOS
+ end
+ end
+
def self.create(type, compiler)
if type && ![:libstdcxx, :libcxx].include?(type)
raise ArgumentError, "Invalid C++ stdlib type: #{type}"
@@ -18,7 +27,7 @@ class CxxStdlib
begin
stdlib.check_dependencies(formula, deps)
- rescue IncompatibleCxxStdlibs => e
+ rescue CompatibilityError => e
opoo e.message
end
end
@@ -51,7 +60,7 @@ class CxxStdlib
dep_stdlib = Tab.for_formula(dep.to_formula).cxxstdlib
if !compatible_with? dep_stdlib
- raise IncompatibleCxxStdlibs.new(formula, dep, dep_stdlib, self)
+ raise CompatibilityError.new(formula, dep, dep_stdlib)
end
end
end
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index d0d83bc89..743f63b0f 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -112,15 +112,6 @@ class UnsatisfiedRequirements < Homebrew::InstallationError
end
end
-class IncompatibleCxxStdlibs < Homebrew::InstallationError
- def initialize(f, dep, wrong, right)
- super f, <<-EOS.undent
- #{f} dependency #{dep} was built with a different C++ standard
- library (#{wrong.type_string} from #{wrong.compiler}). This could cause problems at runtime.
- EOS
- end
-end
-
class FormulaConflictError < Homebrew::InstallationError
attr_reader :f, :conflicts