<commit_before>require 'braintree'
require 'capybara'
require 'digest/md5'
require 'fileutils'
require 'active_support/core_ext'
require 'sinatra/base'

require 'fake_braintree/helpers'
require 'fake_braintree/customer'
require 'fake_braintree/subscription'
require 'fake_braintree/redirect'
require 'fake_braintree/credit_card'
require 'fake_braintree/address'

require 'fake_braintree/registry'
require 'fake_braintree/server'
require 'fake_braintree/sinatra_app'
require 'fake_braintree/valid_credit_cards'
require 'fake_braintree/version'

module FakeBraintree
  mattr_accessor :registry, :verify_all_cards, :decline_all_cards

  # Public: Prepare FakeBraintree for use and start the API server.
  #
  # options: Hash options to configure (default: {}):
  #          :gateway_port - The port to start the API server on (optional).
  #                          If not given, an ephemeral port will be used.
  #
  def self.activate!(options = {})
    initialize_registry
    self.verify_all_cards = false
    set_configuration
    clear!
    boot_server(port: options.fetch(:gateway_port, nil))
  end<commit_msg>Fix creating log directory before initializing Logger<commit_after>require 'braintree'
require 'capybara'
require 'digest/md5'
require 'fileutils'
require 'active_support/core_ext'
require 'sinatra/base'

require 'fake_braintree/helpers'
require 'fake_braintree/customer'
require 'fake_braintree/subscription'
require 'fake_braintree/redirect'
require 'fake_braintree/credit_card'
require 'fake_braintree/address'

require 'fake_braintree/registry'
require 'fake_braintree/server'
require 'fake_braintree/sinatra_app'
require 'fake_braintree/valid_credit_cards'
require 'fake_braintree/version'

module FakeBraintree
  mattr_accessor :registry, :verify_all_cards, :decline_all_cards

  # Public: Prepare FakeBraintree for use and start the API server.
  #
  # options: Hash options to configure (default: {}):
  #          :gateway_port - The port to start the API server on (optional).
  #                          If not given, an ephemeral port will be used.
  #
  def self.activate!(options = {})
    initialize_registry
    self.verify_all_cards = false
    clear!
    set_configuration
    boot_server(port: options.fetch(:gateway_port, nil))
  end
{'fraction_non_alphanumeric': 0.08465608465608465, 'fraction_numerical': 0.0008818342151675485, 'mean_word_length': 4.7735368956743, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5177901', 'n_tokens_mistral': 726, 'n_tokens_neox': 721, 'n_words': 177}