<commit_before>module MoySklad
  # Returns the global [Configuration](MoySklad/Configuration) object. While you
  # _can_ use this method to access the configuration, the more common
  # convention is to use [MoySklad.configure](MoySklad#configure-class_method).
  #
  # @example
  #     MoySklad.configuration.user_name = 'admin@example'
  # @see MoySklad.configure
  # @see Configuration
  def self.configuration
    @configuration ||= MoySklad::Configuration.new
  end

  # Yields the global configuration to a block.
  # @yield [Configuration] global configuration
  #
  # @example
  #     MoySklad.configure do |config|
  #       config.user_name 'admin@example'
  #       config.password '<PASSWORD>'
  #     end
  # @see Configuration
  def self.configure
    yield configuration if block_given?
  end

  # Stores runtime configuration information.
  #
  # @example
  #     MoySklad.configure do |config|
  #       config.user_name 'admin@example'
  #       config.password '<PASSWORD>'
  #     end
  #
  # @see MoySklad.configure
  class Configuration
    # User name for authentication.
    # @attr value [String] defaults to `''`
    attr_accessor :user_name

    # Password for authentication.
    # @attr value [String] defaults to `''`
    attr_accessor :password

    # Base url.
    # @attr value [String] defaults to
    # `'https://online.moysklad.ru/exchange/rest/ms/xml'`
    attr_accessor :base_url

    # Currency UUID.
    # @attr value [String] defaults to
    # `'131bf5ff-1ee5-11e4-67ed-002590a28eca'`
    attr_accessor :currency
  
    def initialize
      @user_name = ''
      @password = ''
      @base_url = 'https://online.moysklad.ru/exchange/rest/ms/xml'
      @currency = '131bf5ff-1ee5-11e4-67ed-002590a28eca'
    end
  end
end<commit_msg>Reconfigure base class on each config { } call, this required because rails initializer are called AFTER the gem<commit_after>module MoySklad
  # Returns the global [Configuration](MoySklad/Configuration) object. While you
  # _can_ use this method to access the configuration, the more common
  # convention is to use [MoySklad.configure](MoySklad#configure-class_method).
  #
  # @example
  #     MoySklad.configuration.user_name = 'admin<EMAIL>'
  # @see MoySklad.configure
  # @see Configuration
  def self.configuration
    @configuration ||= MoySklad::Configuration.new
  end

  # Yields the global configuration to a block.
  # @yield [Configuration] global configuration
  #
  # @example
  #     MoySklad.configure do |config|
  #       config.user_name 'admin<EMAIL>'
  #       config.password '<PASSWORD>'
  #     end
  # @see Configuration
  def self.configure
    yield configuration if block_given?
    MoySklad::Client::Base.user = @configuration.user_name
    MoySklad::Client::Base.password = <PASSWORD>
    MoySklad::Client::Base.site = @configuration.base_url
  end

  # Stores runtime configuration information.
  #
  # @example
  #     MoySklad.configure do |config|
  #       config.user_name 'admin<EMAIL>'
  #       config.password '<PASSWORD>'
  #     end
  #
  # @see MoySklad.configure
  class Configuration
    # User name for authentication.
    # @attr value [String] defaults to `''`
    attr_accessor :user_name

    # Password for authentication.
    # @attr value [String] defaults to `''`
    attr_accessor :password

    # Base url.
    # @attr value [String] defaults to
    # `'https://online.moysklad.ru/exchange/rest/ms/xml'`
    attr_accessor :base_url

    # Currency UUID.
    # @attr value [String] defaults to
    # `'131bf5ff-1ee5-11e4-67ed-002590a28eca'`
    attr_accessor :currency

    def initialize
      @user_name = ''
      @password = ''
      @base_url = 'https://online.moysklad.ru/exchange/rest/ms/xml'
      @currency = '131bf5ff-1ee5-11e4-67ed-002590a28eca'
    end
  end
end
{'fraction_non_alphanumeric': 0.1055672268907563, 'fraction_numerical': 0.01995798319327731, 'mean_word_length': 3.1267605633802815, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '902079', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1244, 'n_words': 291}