<commit_before>require 'etc'
require 'optparse'
require 'gli/copy_options_to_aliases'
require 'gli/dsl'

module GLI
  # A means to define and parse a command line interface that works as
  # Git's does, in that you specify global options, a command name, command
  # specific options, and then command arguments.
  module App
    include CopyOptionsToAliases
    include DSL
    include AppSupport

    # Loads ruby files in the load path that start with 
    # +path+, which are presumed to be commands for your executable.
    # This is a glorified +require+, but could also be used as a plugin mechanism.
    # You could manipualte the load path at runtime and this call
    # would find those files
    #
    # path:: a path relative to somewhere in the <code>LOAD_PATH</code>, from which all <code>.rb</code> files will be required.
    def commands_from(path)
      $LOAD_PATH.each do |load_path|
        commands_path = File.join(load_path,path)
        if File.exists? commands_path
          Dir.entries(commands_path).each do |entry|
            file = File.join(commands_path,entry)
            if file =~ /\.rb$/
              require file
            end
          end
        end
      end
    end

    # Describe the overall application/programm.  This should be a one-sentence summary
    # of what your program does that will appear in the help output.
    #
    # +description+:: A String of the short description of your program's purpose
    def program_desc(description=nil) 
      if description
        @program_desc = description
      end
      @program_desc
    end

    # Use this if the following command should not have the pre block executed.
    # By default, the pre block is executed before each command and can result in
    # aborting the call.  Using this will avoid that behavior for the following command
    def skips_pre<commit_msg>Make the commands_from list more deterministic<commit_after>require 'etc'
require 'optparse'
require 'gli/copy_options_to_aliases'
require 'gli/dsl'

module GLI
  # A means to define and parse a command line interface that works as
  # Git's does, in that you specify global options, a command name, command
  # specific options, and then command arguments.
  module App
    include CopyOptionsToAliases
    include DSL
    include AppSupport

    # Loads ruby files in the load path that start with 
    # +path+, which are presumed to be commands for your executable.
    # This is a glorified +require+, but could also be used as a plugin mechanism.
    # You could manipualte the load path at runtime and this call
    # would find those files
    #
    # path:: a path relative to somewhere in the <code>LOAD_PATH</code>, from which all <code>.rb</code> files will be required.
    def commands_from(path)
      $LOAD_PATH.each do |load_path|
        commands_path = File.join(load_path,path)
        if File.exists? commands_path
          Dir.entries(commands_path).sort.each do |entry|
            file = File.join(commands_path,entry)
            if file =~ /\.rb$/
              require file
            end
          end
        end
      end
    end

    # Describe the overall application/programm.  This should be a one-sentence summary
    # of what your program does that will appear in the help output.
    #
    # +description+:: A String of the short description of your program's purpose
    def program_desc(description=nil) 
      if description
        @program_desc = description
      end
      @program_desc
    end

    # Use this if the following command should not have the pre block executed.
    # By default, the pre block is executed before each command and can result in
    # aborting the call.  Using this will avoid that behavior for the following command
    def skips_pre
{'fraction_non_alphanumeric': 0.05737704918032787, 'fraction_numerical': 0.0, 'mean_word_length': 2.71976401179941, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4351634', 'n_tokens_mistral': 1019, 'n_tokens_neox': 985, 'n_words': 452}