<commit_before>require 'services/base_finder'

class Model
  class << self
    def table_name
      'models'
    end

    # Stub ActiveRecord methods
    %i(select order where limit page per).each do |m|
      define_method m do |*args|
        self
      end
    end
  end

  attr_reader :id

  def initialize(id)
    @id = id
    ModelRepository.add self
  end

  def ==(another_model)
    self.id == another_model.id
  end
end

class ModelRepository
  def self.add(model)
    @models ||= []
    @models << model
  end

  def self.find(id)
    return nil unless defined?(@models)
    @models.detect do |model|
      model.id == id
    end
  end
end

module Services
  module Models
    class BaseFind < Services::BaseFinder
      private def process(scope, conditions)
        scope
      end
    end

    class Find < Services::Base
      def call(ids)
        ids.map { |id| ModelRepository.find id }.compact
      end
    end
<commit_msg>fix specs for ruby 2.0<commit_after>require 'services/base_finder'

class Model
  class << self
    def table_name
      'models'
    end

    # Stub ActiveRecord methods
    %i(select order where limit page per).each do |m|
      define_method m do |*args|
        self
      end
    end
  end

  attr_reader :id

  def initialize(id)
    @id = id
    ModelRepository.add self
  end

  def ==(another_model)
    self.id == another_model.id
  end
end

class ModelRepository
  def self.add(model)
    @models ||= []
    @models << model
  end

  def self.find(id)
    return nil unless defined?(@models)
    @models.detect do |model|
      model.id == id
    end
  end
end

module Services
  module Models
    class BaseFind < Services::BaseFinder
      private

      def process(scope, conditions)
        scope
      end
    end

    class Find < Services::Base
      def call(ids)
        ids.map { |id| ModelRepository.find id }.compact
      end
    end

{'fraction_non_alphanumeric': 0.0825446898002103, 'fraction_numerical': 0.0010515247108307045, 'mean_word_length': 2.230899830220713, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 3, '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': '6318725', 'n_tokens_mistral': 615, 'n_tokens_neox': 596, 'n_words': 188}