<commit_before>require 'active_support/rescuable'
require 'logger'
require "contingency/exceptions"
require "contingency/adapters/interface"

module Contingency

  class << self
    attr_accessor :configuration
    attr_accessor :adapter, :adapters
  end

  self.adapters = Contingency::Adapters.constants.reject{ |a| a == :Interface }

  def self.configure
    self.adapter ||= Contingency::Adapters.const_get self.adapters.first || Adapters::Interface
    self.configuration ||= defined?(self.adapter::Configuration) ? self.adapter::Configuration.new : Configuration.new

    yield(configuration) if block_given?

    require "contingency/plan"

    configuration
  end

  def self.logger
    @logger ||= configuration.logger
  end


end

require "contingency/configuration"
require "contingency/version"
<commit_msg>Try to fix gem-only error in determining adapters.<commit_after>require 'active_support/rescuable'
require 'logger'
require "contingency/exceptions"
require "contingency/adapters/interface"

module Contingency

  class << self
    attr_accessor :configuration
    attr_accessor :adapter, :adapters
  end


  def self.configure
    self.adapters = Contingency::Adapters.constants.reject{ |a| a == :Interface }
    self.adapter ||= self.adapters.length > 0 ? Contingency::Adapters.const_get self.adapters.first : Adapters::Interface
    self.configuration ||= defined?(self.adapter::Configuration) ? self.adapter::Configuration.new : Configuration.new

    yield(configuration) if block_given?

    require "contingency/plan"

    configuration
  end

  def self.logger
    @logger ||= configuration.logger
  end


end

require "contingency/configuration"
require "contingency/version"

{'fraction_non_alphanumeric': 0.10041103934233706, 'fraction_numerical': 0.0005871990604815032, 'mean_word_length': 4.756756756756757, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, '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': '5856574', 'n_tokens_mistral': 523, 'n_tokens_neox': 491, 'n_words': 109}