aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-03-13 02:07:01 -0500
committerJack Nagel2013-03-16 13:05:02 -0500
commitf91df69127967889a5e7ee7ac6decc6842b7b1cc (patch)
treed66955babbbde1628f5e2e1038262cd4dfbd693f /Library
parentb6d9c3496e67b8f143618d45e8b7a7d29b605cdc (diff)
downloadhomebrew-f91df69127967889a5e7ee7ac6decc6842b7b1cc.tar.bz2
Replace custom collection with Set
The original constraints that led to using a custom collection rather than Array or Set here no longer exist, so let's avoid the pointless abstraction here.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/compilers.rb23
-rw-r--r--Library/Homebrew/formula.rb8
2 files changed, 2 insertions, 29 deletions
diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb
index f9ed8bcde..b4fbef99c 100644
--- a/Library/Homebrew/compilers.rb
+++ b/Library/Homebrew/compilers.rb
@@ -21,29 +21,6 @@ class Compilers
end
-class CompilerFailures
- include Enumerable
-
- def initialize(*args)
- @failures = Array.new(*args)
- end
-
- def each(*args, &block)
- @failures.each(*args, &block)
- end
-
- def include?(cc)
- cc = Compiler.new(cc) unless cc.is_a? Compiler
- @failures.any? { |failure| failure.compiler == cc.name }
- end
-
- def <<(o)
- @failures << o unless include? o.compiler
- self
- end
-end
-
-
class Compiler
attr_reader :name, :build
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 9234b45df..7ba0cd01e 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -785,12 +785,8 @@ private
end
def fails_with compiler, &block
- @cc_failures ||= CompilerFailures.new
- @cc_failures << if block_given?
- CompilerFailure.new(compiler, &block)
- else
- CompilerFailure.new(compiler)
- end
+ @cc_failures ||= Set.new
+ @cc_failures << CompilerFailure.new(compiler, &block)
end
def test &block