<commit_before>include Rake::DSL
#require 'ruby-debug'
# call with 'rake trackable_task:my_task log_level=debug' or 'rake trackable_task:my_task[:debug]'
namespace :trackable_task do

  trackable_task_list = []
  Dir.foreach("#{RAILS_ROOT}/lib/trackable_tasks/") do |file_name|
    next if file_name == "." || file_name == ".."
    file_name['.rb'] = ''
    trackable_task_list.push(file_name.to_sym)
  end

  trackable_task_list.each do |task_name|
    desc "Trackable task for #{task_name.to_s.camelize}.  Log levels include debug, notice, and error."
    task task_name, :log_level do |t, args|
      args = ENV["log_level"] ? { :log_level => ENV["log_level"] } : args.with_defaults(:log_level => :notice)
      puts "I am running #{task_name.to_s} task and args #{args}"
      # if the class exists
        # if the class has a superclass of trackable task base
          # initialize
          # run task
    end
  end
end<commit_msg>Now have two rake task solutions.  Trying to decide on the best one.<commit_after>include Rake::DSL
#require 'ruby-debug'
# call with 'rake trackable_task:my_task log_level=debug' or 'rake trackable_task:my_task[:debug]'
namespace :trackable_task do

  trackable_task_list = []
  Dir.foreach("#{RAILS_ROOT}/lib/trackable_tasks/") do |file_name|
    next if file_name == "." || file_name == ".."
    file_name['.rb'] = ''
    trackable_task_list.push(file_name.to_sym)
  end
  puts "running the trackable task loader"

  trackable_task_list.each do |task_name|
    desc "Trackable task for #{task_name.to_s.camelize}.  Log levels include debug, notice, and error."
    task task_name, :log_level do |t, args|
      args = ENV["log_level"] ? { :log_level => ENV["log_level"] } : args.with_defaults(:log_level => :notice)
      puts "I am running #{task_name.to_s} task and args #{args}"
      # if the class exists
        # if the class has a superclass of trackable task base
          # initialize
          # run task
    end
  end

  desc "Runs a trackable task by passing in the task as an argument"
  task :run_task, :task_name, :log_level do |t, args|
    args[:log_level] = args.with_defaults(:log_level => :notice)
    puts "I am running #{args[:task_name]} at log level #{args[:log_level]}"
  end
end
{'fraction_non_alphanumeric': 0.12144128113879003, 'fraction_numerical': 0.0, 'mean_word_length': 3.675675675675676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '4927084', 'n_tokens_mistral': 765, 'n_tokens_neox': 755, 'n_words': 214}