<commit_before>$:.push File.expand_path("../lib", __FILE__)

require "braspag/version"
require "savon"
require "securerandom"
require "logger"
require "braspag/savon_adapter"
require "braspag/request"
require "braspag/response"
require "braspag/response_errors"
require "braspag/response_handler"
require "braspag/payment_data_request_xml"
require "braspag/transaction_param_builder"
require "braspag/transaction"
require "braspag/credit_card"

module Braspag
  TRANSACTION_WSDL = {
    :homologation => "https://homologacao.pagador.com.br/webservice/pagadorTransaction.asmx?wsdl",
    :production => "https://pagador.com.br/webservice/pagadorTransaction.asmx?wsdl"
  }

  CREDIT_CARD_WSDL = {
    :homologation => "https://homologacao.braspag.com.br/services/testenvironment/CartaoProtegido.asmx?wsdl",
    :production => "https://cartaoprotegido.braspag.com.br/Services/V2/CartaoProtegido.asmx?wsdl"
  }

  class << self
    attr_accessor :merchant_id, :merchant_key, :logging, :production, :payment_data_request_xml_builder

    def credit_card_wsdl
      production? ? CREDIT_CARD_WSDL[:production] : CREDIT_CARD_WSDL[:homologation]
    end

    def transaction_wsdl
      production? ? TRANSACTION_WSDL[:production] : TRANSACTION_WSDL[:homologation]
    end

    def production?
      production
    end
  end

  def self.configure
    yield self
  end

end

Braspag.configure do |config|
  config.production = false
  config.logging    = false
  config.payment_data_request_xml_builder = Braspag::PaymentDataRequestXML
end<commit_msg>Define root path for gem and improve requires<commit_after>$:.push File.expand_path("../lib", __FILE__)

require "savon"
require "securerandom"
require "logger"

module Braspag
  TRANSACTION_WSDL = {
    :homologation => "https://homologacao.pagador.com.br/webservice/pagadorTransaction.asmx?wsdl",
    :production => "https://pagador.com.br/webservice/pagadorTransaction.asmx?wsdl"
  }

  CREDIT_CARD_WSDL = {
    :homologation => "https://homologacao.braspag.com.br/services/testenvironment/CartaoProtegido.asmx?wsdl",
    :production => "https://cartaoprotegido.braspag.com.br/Services/V2/CartaoProtegido.asmx?wsdl"
  }

  class << self
    attr_accessor :merchant_id, :merchant_key, :logging, :production, :payment_data_request_xml_builder

    def credit_card_wsdl
      production? ? CREDIT_CARD_WSDL[:production] : CREDIT_CARD_WSDL[:homologation]
    end

    def transaction_wsdl
      production? ? TRANSACTION_WSDL[:production] : TRANSACTION_WSDL[:homologation]
    end

    def production?
      production
    end
  end

  def self.root
    Pathname.new File.expand_path('../..', __FILE__)
  end

  def self.configure
    yield self
  end
end

Dir[Braspag.root.join('lib/braspag/**/*.rb')].each { |f| require f }

Braspag.configure do |config|
  config.production = false
  config.logging    = false
  config.payment_data_request_xml_builder = Braspag::PaymentDataRequestXML
end
{'fraction_non_alphanumeric': 0.11160409556313994, 'fraction_numerical': 0.0006825938566552901, 'mean_word_length': 4.6365384615384615, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, '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': '3165210', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1003, 'n_words': 160}