From ab91e3d8ba28862680a82bd241be996405b28d82 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sun, 29 Jun 2014 00:10:11 +0000 Subject: [PATCH] Remove singleton .each on matcher --- lib/mutant/matcher.rb | 20 -------------------- lib/mutant/matcher/scope.rb | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/lib/mutant/matcher.rb b/lib/mutant/matcher.rb index e286511f..dc32dc51 100644 --- a/lib/mutant/matcher.rb +++ b/lib/mutant/matcher.rb @@ -3,26 +3,6 @@ module Mutant class Matcher include Adamantium::Flat, Enumerable, AbstractType - # Enumerate subjects - # - # @param [Object] input - # - # @return [self] - # if block given - # - # @return [Enumerable] - # otherwise - # - # @api private - # - def self.each(cache, input, &block) - return to_enum(__method__, cache, input) unless block_given? - - build(cache, input).each(&block) - - self - end - # Default matcher build implementation # # @param [Cache] cache diff --git a/lib/mutant/matcher/scope.rb b/lib/mutant/matcher/scope.rb index aae70d64..72221d57 100644 --- a/lib/mutant/matcher/scope.rb +++ b/lib/mutant/matcher/scope.rb @@ -23,7 +23,7 @@ module Mutant return to_enum unless block_given? MATCHERS.each do |matcher| - matcher.each(cache, scope, &block) + matcher.new(cache, scope).each(&block) end self