<commit_before>require 'rutty/consts'

module Rutty
  
  ##
  # The primary mixin module containing the code executed by the rutty bin's actions.
  #
  # @author <NAME>
  # @since 2.0.0
  module Actions
    ##
    # Initialize the Rutty config file structure in the specified directory, or
    # report that the files already exist there.
    #
    # @see Rutty::Runner#config_dir
    # @param [String] dir The directory to install into. {Rutty::Runner#config_dir} ensures
    #   that this falls back to {Rutty::Consts::CONF_DIR} if not passed in by the user.
    def init dir
      require 'yaml'
      
      general_file = File.join(dir, Rutty::Consts::GENERAL_CONF_FILE)
      nodes_file = File.join(dir, Rutty::Consts::NODES_CONF_FILE)
      
      if File.exists? dir
        log "\t<%= color('exists', :cyan) %>", dir
      else
        log "\t<%= color('create', :green) %>", dir
        FileUtils.mkdir_p dir
      end

      if File.exists? general_file
        log "\t<%= color('exists', :cyan) %>", general_file
      else<commit_msg>Add FileUtils require in init action<commit_after>require 'rutty/consts'

module Rutty
  
  ##
  # The primary mixin module containing the code executed by the rutty bin's actions.
  #
  # @author <NAME>
  # @since 2.0.0
  module Actions
    ##
    # Initialize the Rutty config file structure in the specified directory, or
    # report that the files already exist there.
    #
    # @see Rutty::Runner#config_dir
    # @param [String] dir The directory to install into. {Rutty::Runner#config_dir} ensures
    #   that this falls back to {Rutty::Consts::CONF_DIR} if not passed in by the user.
    def init dir
      require 'yaml'
      require 'fileutils'
      
      general_file = File.join(dir, Rutty::Consts::GENERAL_CONF_FILE)
      nodes_file = File.join(dir, Rutty::Consts::NODES_CONF_FILE)
      
      if File.exists? dir
        log "\t<%= color('exists', :cyan) %>", dir
      else
        log "\t<%= color('create', :green) %>", dir
        FileUtils.mkdir_p dir
      end

      if File.exists? general_file
        log "\t<%= color('exists', :cyan) %>", general_file
      else
{'fraction_non_alphanumeric': 0.11292580494633692, 'fraction_numerical': 0.0027998133457769483, 'mean_word_length': 2.7482517482517483, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '470678', 'n_tokens_mistral': 702, 'n_tokens_neox': 673, 'n_words': 212}