<commit_before>require 'yaml'
require 'colorize'
require 'tmpdir'

namespace :hive_tests do
  namespace :config do
    desc 'Generates example config file. Accepts directory to file.'
    task :generate_default, [:config_directory] do |_, args|
      require 'rbconfig'

      host_os = RbConfig::CONFIG['host_os']
      host = host_os =~ /darwin|mac os/ ? '192.168.99.100' : '127.0.0.1'

      default_values = {
        'hive' =>
          {
            'host' => host,
            'port' => 10000,
            'host_shared_directory_path' =>
              File.join(Dir.mktmpdir, 'spec-tmp-file'),
            'docker_shared_directory_path' => '/tmp/spec-tmp-file',
            'hive_version' => '10'
          }
      }
      file_path = File.join(args[:config_directory], 'hive_tests_config.yml')
      File.open(file_path, 'w+') do |f|<commit_msg>Allow to name config file<commit_after>require 'yaml'
require 'colorize'
require 'tmpdir'

namespace :hive_tests do
  namespace :config do
    desc 'Generates example config file. Accepts directory to file.'
    task :generate_default, [:config_directory, :config_file_name] do |_, args|
      require 'rbconfig'

      host_os = RbConfig::CONFIG['host_os']
      host = host_os =~ /darwin|mac os/ ? '192.168.99.100' : '127.0.0.1'

      default_values = {
        'hive' =>
          {
            'host' => host,
            'port' => 10000,
            'host_shared_directory_path' =>
              File.join(Dir.mktmpdir, 'spec-tmp-file'),
            'docker_shared_directory_path' => '/tmp/spec-tmp-file',
            'hive_version' => '10'
          }
      }
      file_path = File.join(
        args[:config_directory],
        args[:config_file_name] || 'hive_tests_config.yml'
      )
      File.open(file_path, 'w+') do |f|
{'fraction_non_alphanumeric': 0.13814317673378076, 'fraction_numerical': 0.026845637583892617, 'mean_word_length': 2.350187265917603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2457452', 'n_tokens_mistral': 628, 'n_tokens_neox': 588, 'n_words': 118}