<commit_before># encoding: utf-8

namespace :metrics do
  begin
    require 'simplecov'

    desc 'Generate code coverage'
    task :coverage do
      begin
        original, ENV['COVERAGE'] = ENV['COVERAGE'], 'true'
        Rake::Task['spec:unit'].execute
      ensure
        ENV['COVERAGE'] = original
      end
    end
  rescue LoadError
    task :coverage do
      $stderr.puts "coverage is not available. In order to run simplecov, you must: gem install simplecov"
    end
  end
end<commit_msg>Update metrics:coverage to run the unit tests when simplecov not available<commit_after># encoding: utf-8

namespace :metrics do
  begin
    require 'simplecov'

    desc 'Generate code coverage'
    task :coverage do
      begin
        original, ENV['COVERAGE'] = ENV['COVERAGE'], 'true'
        Rake::Task['spec:unit'].invoke
      ensure
        ENV['COVERAGE'] = original
      end
    end
  rescue LoadError
    task :coverage do
      $stderr.puts "coverage is not available. In order to run simplecov, you must: gem install simplecov"
      Rake::Task['spec:unit'].invoke
    end
  end
end
{'fraction_non_alphanumeric': 0.09206927985414767, 'fraction_numerical': 0.0018231540565177757, 'mean_word_length': 2.7993079584775087, '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': '2200393', 'n_tokens_mistral': 331, 'n_tokens_neox': 328, 'n_words': 110}