<commit_before>Gem.loaded_specs["fogged"].dependencies.select { |d| d.type == :runtime }.each do |d|
  require d.name
end

require "fogged/engine"
require "fogged/acts_as_having_one_resource"
require "fogged/acts_as_having_many_resources"

module Fogged
  mattr_accessor :provider
  @@provider = nil

  mattr_accessor :resources
  @@resources = nil

  mattr_accessor :test_enabled
  @@test_enabled = false

  # controller
  mattr_accessor :parent_controller
  @@parent_controller = "ApplicationController"

  # aws
  mattr_accessor :aws_key
  @@aws_key = nil
  mattr_accessor :aws_secret
  @@aws_secret = nil
  mattr_accessor :aws_bucket
  @@aws_bucket = nil
  mattr_accessor :aws_region
  @@aws_region = nil

  # zencoder
  mattr_accessor :zencoder_enabled
  @@zencoder_enabled = false
  mattr_accessor :zencoder_polling_frequency
  @@zencoder_polling_frequency = 10

  def self.configure
    yield self
  end

  def self.resources
    return @@resources if @@resources
    return @@resources = test_resources if Fogged.test_enabled

    case Fogged.provider
    when :aws
      Fogged.resources = aws_resources
    else
      fail(ArgumentError, "Provider #{Fogged.provider} is not available!")
    end
  end

  def self.test_mode!
    self.test_enabled = true
  end

  private

  def self.test_resources
    Fog.mock!
    storage = Fog::Storage.new(
      :provider => "AWS",
      :aws_access_key_id => "1234567890",
      :aws_secret_access_key => "1234567890"
    )
    @@aws_key = "1234567890"
    @@aws_secret_access_key = "1234567890"
    @@aws_bucket = "test"
    storage.directories.create(:key => "test")
  end<commit_msg>Fix typo in env var name<commit_after>Gem.loaded_specs["fogged"].dependencies.select { |d| d.type == :runtime }.each do |d|
  require d.name
end

require "fogged/engine"
require "fogged/acts_as_having_one_resource"
require "fogged/acts_as_having_many_resources"

module Fogged
  mattr_accessor :provider
  @@provider = nil

  mattr_accessor :resources
  @@resources = nil

  mattr_accessor :test_enabled
  @@test_enabled = false

  # controller
  mattr_accessor :parent_controller
  @@parent_controller = "ApplicationController"

  # aws
  mattr_accessor :aws_key
  @@aws_key = nil
  mattr_accessor :aws_secret
  @@aws_secret = nil
  mattr_accessor :aws_bucket
  @@aws_bucket = nil
  mattr_accessor :aws_region
  @@aws_region = nil

  # zencoder
  mattr_accessor :zencoder_enabled
  @@zencoder_enabled = false
  mattr_accessor :zencoder_polling_frequency
  @@zencoder_polling_frequency = 10

  def self.configure
    yield self
  end

  def self.resources
    return @@resources if @@resources
    return @@resources = test_resources if Fogged.test_enabled

    case Fogged.provider
    when :aws
      Fogged.resources = aws_resources
    else
      fail(ArgumentError, "Provider #{Fogged.provider} is not available!")
    end
  end

  def self.test_mode!
    self.test_enabled = true
  end

  private

  def self.test_resources
    Fog.mock!
    storage = Fog::Storage.new(
      :provider => "AWS",
      :aws_access_key_id => "1234567890",
      :aws_secret_access_key => "1234567890"
    )
    @@aws_key = "1234567890"
    @@aws_secret = "1234567890"
    @@aws_bucket = "test"
    storage.directories.create(:key => "test")
  end
{'fraction_non_alphanumeric': 0.09424724602203183, 'fraction_numerical': 0.025703794369645042, 'mean_word_length': 3.8357988165680474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2585926', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1112, 'n_words': 240}