<commit_before>require "bundler"

module Ellen
  class Robot
    attr_reader :options

    def initialize(options)
      @options = options
    end

    def run
      bundle
      adapt
    end

    private

    def adapt
      adapter.run
    end

    def adapter
      AdapterBuilder.new(options).build
    end

    def bundle
      Bundler.require
    end
  end
end
<commit_msg>[Refactor] Memoize adapter to speed things up<commit_after>require "bundler"
require "mem"

module Ellen
  class Robot
    include Mem

    attr_reader :options

    def initialize(options)
      @options = options
    end

    def run
      bundle
      adapt
    end

    private

    def adapt
      adapter.run
    end

    def adapter
      AdapterBuilder.new(self, options).build
    end
    memoize :adapter

    def bundle
      Bundler.require
    end
  end
end

{'fraction_non_alphanumeric': 0.04460093896713615, 'fraction_numerical': 0.0, 'mean_word_length': 1.9515570934256055, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3053723', 'n_tokens_mistral': 262, 'n_tokens_neox': 248, 'n_words': 79}