<commit_before>require 'optparse'
require 'yaml'

require File.expand_path('../version', __FILE__)

module DCase
  class Config
    attr_accessor :args, :side, :server, :port, :password, :config_path

    def initialize(args)
      @args = args || []

      parse_args
      read_config

      check_values
    end

    def check_values
      if side.nil?
        raise 'You need to define side of dcase in'
      end

      if server.nil?
        raise 'You need to define remote server address'
      end

      if port.nil?
        raise 'You need to define remote server port'<commit_msg>local side should ignore remote server address checking<commit_after>require 'optparse'
require 'yaml'

require File.expand_path('../version', __FILE__)

module DCase
  class Config
    attr_accessor :args, :side, :server, :port, :password, :config_path

    def initialize(args)
      @args = args || []

      parse_args
      read_config

      check_values
    end

    def check_values
      if side.nil?
        raise 'You need to define side of dcase in'
      end

      if side == 'local' && server.nil?
        raise 'You need to define remote server address'
      end

      if port.nil?
        raise 'You need to define remote server port'
{'fraction_non_alphanumeric': 0.08032128514056225, 'fraction_numerical': 0.0, 'mean_word_length': 2.4611111111111112, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5588490', 'n_tokens_mistral': 368, 'n_tokens_neox': 355, 'n_words': 130}