<commit_before>
class Tryouts; module CLI
  
  # = Run
  #
  # The logic bin/tryouts uses for running tryouts. 
  class Run < Drydock::Command

    def init
      @tryouts_globs = [GYMNASIUM_GLOB, File.join(Dir.pwd, '*_tryouts.rb')]
    end
    
    def dreams
      load_available_tryouts_files
      puts Tryouts.dreams.to_yaml
    end
    
    def run
      load_available_tryouts_files
      Tryouts.run
    end
    
    
  private 
    def load_available_tryouts_files
      if @argv.files
        @argv.files.each do |file|
          file = File.join(file, '**', '*_tryouts.rb') if File.directory?(file)
          @tryouts_globs += file
        end
      end

      @tryouts_files = []
      @tryouts_globs.each do |glob|
        @tryouts_files += Dir.glob glob
      end
      @tryouts_files.uniq!

      puts "FOUND:", @tryouts_files if @global.verbose > 0
      
      @tryouts_files.each { |file| Tryouts.parse_file file }
    end
  end
end; end<commit_msg>Added list command to print known tryouts based on the cwd<commit_after>
class Tryouts; module CLI
  
  # = Run
  #
  # The logic bin/tryouts uses for running tryouts. 
  class Run < Drydock::Command

    def init
      @tryouts_globs = [GYMNASIUM_GLOB, File.join(Dir.pwd, '*_tryouts.rb')]
    end
    
    def dreams
      load_available_tryouts_files
      if @global.verbose > 0
        puts Tryouts.dreams.to_yaml
      else
        Tryouts.dreams.each_pair do |n,dreams|
          puts n
          dreams.each_pair do |n, dream|
            puts "  " << n
            dream.each_pair do |n, drill|
              puts "    " << n
            end
          end
        end
      end
    end
    
    def run
      load_available_tryouts_files
      Tryouts.run
    end
    
    def list
      load_available_tryouts_files
      if @global.verbose > 0
        puts Tryouts.instances.to_yaml
      else
        Tryouts.instances.each_pair do |n,tryouts|
          puts n
          tryouts.tryouts.each do |tryout|
            puts "  " << tryout.name
            tryout.drills.each do |drill|
              puts "    " << drill.name
            end
          end
        end
      end
    end
    
  private 
    def load_available_tryouts_files
      if @argv.files
        @argv.files.each do |file|
          file = File.join(file, '**', '*_tryouts.rb') if File.directory?(file)
          @tryouts_globs += file
        end
      end

      @tryouts_files = []
      @tryouts_globs.each do |glob|
        @tryouts_files += Dir.glob glob
      end
      @tryouts_files.uniq!

      puts "FOUND:", @tryouts_files if @global.verbose > 0
      
      @tryouts_files.each { |file| Tryouts.parse_file file }
    end
  end
end; end
{'fraction_non_alphanumeric': 0.08534322820037106, 'fraction_numerical': 0.001484230055658627, 'mean_word_length': 1.7708119218910585, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, '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': '2721592', 'n_tokens_mistral': 915, 'n_tokens_neox': 894, 'n_words': 211}