<commit_before># Require all *.rb files in a given path,
# starting with those matching ordered
def ordered_require(ordered, *path)
  nOrd = ordered.count
  hash = Hash[ordered.each_with_index.to_a]
  files = Dir.glob(File.join(*path, '*.rb'))
  files.sort_by{ |file|
    bn = File.basename(file)
    hash[bn] || nOrd
  }.each { |f|
    require f
  }
end

## Standard Library and Gems
require 'set'
require 'stringio'
require 'irb/ruby-lex'
require 'active_support/core_ext/hash'
require 'active_support/core_ext/string/filters'
## Get the path to this file
fp = File.dirname(__FILE__)
## Info
require_relative 'version'
require_relative 'errors'
## Tokenization
require_relative 'tokens'
require_relative 'precedence'
## Expression
ordered = ['operator.rb']
ordered_require(ordered, fp, 'expression')
## Parser
require_relative 'parse_tree'
require_relative 'lexer'
require_relative 'parser'
## Grammar
ordered = ['configurable.rb', 'operations.rb']
ordered_require(ordered, fp, 'grammar')
## Config
require_relative 'config'
## AST
require_relative 'ast'<commit_msg>use absolute path for portability reasons<commit_after># Require all *.rb files in a given path,
# starting with those matching ordered
def ordered_require(ordered, *path)
  nOrd = ordered.count
  hash = Hash[ordered.each_with_index.to_a]
  files = Dir.glob(File.join(*path, '*.rb'))
  files.sort_by{ |file|
    bn = File.basename(file)
    hash[bn] || nOrd
  }.each { |f|
    require f
  }
end

## Standard Library and Gems
require 'set'
require 'stringio'
require 'irb/ruby-lex'
require 'active_support/core_ext/hash'
require 'active_support/core_ext/string/filters'
## Get the path to this file
fp = File.expand_path(File.dirname(__FILE__))
## Info
require_relative 'version'
require_relative 'errors'
## Tokenization
require_relative 'tokens'
require_relative 'precedence'
## Expression
ordered = ['operator.rb']
ordered_require(ordered, fp, 'expression')
## Parser
require_relative 'parse_tree'
require_relative 'lexer'
require_relative 'parser'
## Grammar
ordered = ['configurable.rb', 'operations.rb']
ordered_require(ordered, fp, 'grammar')
## Config
require_relative 'config'
## AST
require_relative 'ast'
{'fraction_non_alphanumeric': 0.12511457378551788, 'fraction_numerical': 0.0, 'mean_word_length': 5.758513931888545, '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': '3500463', 'n_tokens_mistral': 710, 'n_tokens_neox': 695, 'n_words': 190}