<commit_before>require 'routemaster/receiver/basic'
require 'routemaster/dirty/filter'
require 'routemaster/dirty/map'
require 'delegate'
require 'wisper'

module Routemaster
  module Receiver
    class Filtered
      extend Forwardable
      include Wisper::Publisher

      def initialize(app, options = {})
        @redis    = options.fetch(:redis)
        @basic    = Basic.new(app, options)
        @map      = options.fetch(:dirty_map) { Dirty::Map.new(@redis) }
        @filter   = Dirty::Filter.new(redis: @redis)

        @basic.subscribe(@filter, prefix: true)
        @filter.on(:entity_changed) { |url| @map.mark(url) }
        @map.on(:dirty_entity) { |url| publish(:sweep_needed, @map) }
      end

      delegate [:call] => :@basic
    end
  end
end<commit_msg>Removes default map from Receiver::Filter<commit_after>require 'routemaster/receiver/basic'
require 'routemaster/dirty/filter'
require 'routemaster/dirty/map'
require 'delegate'
require 'wisper'

module Routemaster
  module Receiver
    class Filtered
      extend Forwardable
      include Wisper::Publisher

      def initialize(app, options = {})
        @redis    = options.fetch(:redis)
        @basic    = Basic.new(app, options)
        @map      = options.fetch(:dirty_map)
        @filter   = Dirty::Filter.new(redis: @redis)

        @basic.subscribe(@filter, prefix: true)
        @filter.on(:entity_changed) { |url| @map.mark(url) }
        @map.on(:dirty_entity) { |url| publish(:sweep_needed) }
      end

      delegate [:call] => :@basic
    end
  end
end
{'fraction_non_alphanumeric': 0.1279896574014221, 'fraction_numerical': 0.0, 'mean_word_length': 3.010362694300518, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6624300', 'n_tokens_mistral': 516, 'n_tokens_neox': 493, 'n_words': 103}