aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/exceptions.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-07-01 05:32:19 +0200
committerGitHub2017-07-01 05:32:19 +0200
commitfd5e673d2d367eff03f1411d909ca0bbb2003a2c (patch)
treef908de0884ea7048aa79caedc726ef8a8cc12818 /Library/Homebrew/cask/lib/hbc/exceptions.rb
parent0a5052141d59ece4adb3c9dbd62096c7a2ed7282 (diff)
parent6a1fa87191bfef31ff1b2d47d3ebf281398a210f (diff)
downloadbrew-fd5e673d2d367eff03f1411d909ca0bbb2003a2c.tar.bz2
Merge pull request #2825 from reitermarkus/refactoring
Refactoring using `Forwardable` and `DelegateClass`.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/exceptions.rb')
-rw-r--r--Library/Homebrew/cask/lib/hbc/exceptions.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/exceptions.rb b/Library/Homebrew/cask/lib/hbc/exceptions.rb
index d9e1b07db..1a246be65 100644
--- a/Library/Homebrew/cask/lib/hbc/exceptions.rb
+++ b/Library/Homebrew/cask/lib/hbc/exceptions.rb
@@ -77,9 +77,15 @@ module Hbc
end
end
- class CaskCyclicCaskDependencyError < AbstractCaskErrorWithToken
+ class CaskCyclicDependencyError < AbstractCaskErrorWithToken
def to_s
- "Cask '#{token}' includes cyclic dependencies on other Casks and could not be installed."
+ "Cask '#{token}' includes cyclic dependencies on other Casks" << (reason.empty? ? "." : ": #{reason}")
+ end
+ end
+
+ class CaskSelfReferencingDependencyError < CaskCyclicDependencyError
+ def to_s
+ "Cask '#{token}' depends on itself."
end
end
@@ -91,7 +97,7 @@ module Hbc
class CaskInvalidError < AbstractCaskErrorWithToken
def to_s
- "Cask '#{token}' definition is invalid" << (reason.empty? ? ".": ": #{reason}")
+ "Cask '#{token}' definition is invalid" << (reason.empty? ? "." : ": #{reason}")
end
end