<commit_before>require 'rspec/core/rake_task'

spec_tasks = Dir['spec/*/'].map { |d| File.basename(d) }

spec_tasks.each do |folder|
  RSpec::Core::RakeTask.new("spec:#{folder}") do |t|
    t.pattern = "./spec/#{folder}/**/*_spec.rb"
    t.rspec_opts = %w(-fs --color)
  end
end

desc "Run complete application spec suite"
task 'spec' => spec_tasks.map { |f| "spec:#{f}" }<commit_msg>Make rake tasks run without rspec<commit_after>begin
  require 'rspec/core/rake_task'

  spec_tasks = Dir['spec/*/'].each_with_object([]) do |d, result|
    result << File.basename(d) unless Dir["#{d}*"].empty?
  end

  spec_tasks.each do |folder|
    desc "Run the spec suite in #{folder}"
    RSpec::Core::RakeTask.new("spec:#{folder}") do |t|
      t.pattern = "./spec/#{folder}/**/*_spec.rb"
      t.rspec_opts = "--color"
    end
  end

  desc "Run complete application spec suite"
  task 'spec' => spec_tasks.map { |f| "spec:#{f}" }
rescue LoadError
  task :spec do
    puts "RSpec is not part of this bundle, skip specs."
  end
end

task :default => :spec
{'fraction_non_alphanumeric': 0.1826003824091778, 'fraction_numerical': 0.0, 'mean_word_length': 3.695067264573991, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '3571863', 'n_tokens_mistral': 387, 'n_tokens_neox': 386, 'n_words': 98}