<commit_before>module BeaveroFonts
  def self.included(base)
    # Fonts included
  end

  def self.build(config)
    check_configuration(config)
    
    # List files without directories
    files = Dir.glob( File.join( @@config[:paths][:fonts], '**', '*' + '.{' + @@config[:fonts][:ext].join(',') + '}' ) ).reject do |path|
      File.directory? path
    end

    # Copy everything
    files.each do |file|
      name = File.basename(file)
      FileUtils.mv( file, File.join( @@config[:paths][:output], name) )
      Beavero.log("Fonts: '" + name.italic + "' moved.", 'info')
    end

    Beavero.log("Fonts builded successfully!", 'success')
  end

  private

  def self.check_configuration(config)
    @@config = config

    # Defaults
    @@config[:paths][:fonts] = './assets/fonts/' unless @@config[:paths][:fonts]<commit_msg>Fonts - improve function readability<commit_after>module BeaveroFonts
  def self.included(base)
    # Fonts included
  end

  def self.build(config)
    check_configuration(config)
    
    # List files without directories
    files = Dir.glob( File.join( 
      @@config[:paths][:app], 
      @@config[:paths][:fonts], 
      '**', 
      '*' + '.{' + @@config[:fonts][:ext].join(',') + '}' 
    ) )
    files.reject do |path|
      File.directory? path
    end

    # Copy everything
    files.each do |file|
      name = File.basename(file)
      FileUtils.mv( file, File.join( @@config[:paths][:output], name) )
      Beavero.log("Fonts: '" + name.italic + "' moved.", 'info')
    end

    Beavero.log("Fonts builded successfully!", 'success')
  end

  private

  def self.check_configuration(config)
    @@config = config

    # Defaults
    @@config[:paths][:fonts] = './assets/fonts/' unless @@config[:paths][:fonts]
{'fraction_non_alphanumeric': 0.17198177676537585, 'fraction_numerical': 0.0, 'mean_word_length': 3.0765661252900234, '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': '73135', 'n_tokens_mistral': 606, 'n_tokens_neox': 560, 'n_words': 117}