<commit_before>module PackRat
  module CacheHelper
    module Cacher
      def cache(key='', options={}, &block)
        unless options[:overwrite_key]
          calling_method = caller[0][/`([^']*)'/, 1]
          key << calling_method << '/'
          key << self.cache_key << '/'
          if self.is_a? Class
            key << self.file_digest
          else
            key << self.class.file_digest
          end
        end
        puts key if options[:debug]
        filtered_options = options.except(:overwrite_key, :debug)
        Rails.cache.fetch key, filtered_options do
          block.call
        end
      end
    end
  end
end<commit_msg>Don't rely on Rails Hash#except ( for testing )<commit_after>module PackRat
  module CacheHelper
    module Cacher
      def cache(key='', options={}, &block)
        unless options[:overwrite_key]
          calling_method = caller[0][/`([^']*)'/, 1]
          key << calling_method << '/'
          key << self.cache_key << '/'
          if self.is_a? Class
            key << self.file_digest
          else
            key << self.class.file_digest
          end
        end
        puts key if options[:debug]
        filtered_options = options.dup
        filtered_options.delete(:debug)
        filtered_options.delete(:overwrite_key)
        Rails.cache.fetch key, filtered_options do
          block.call
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10716820440028389, 'fraction_numerical': 0.0028388928317956, 'mean_word_length': 1.842741935483871, 'pattern_counts': {'":': 0, '<': 27, '<?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': '5306605', 'n_tokens_mistral': 408, 'n_tokens_neox': 401, 'n_words': 99}