<commit_before>#!/usr/bin/env ruby
# init.rb : set up $LOAD_PATH and provide an easy accessor
# Additionally, use the 'app.yml' file to fill in any variables in ENV

module RackSkeleton
    class Settings
        @@root_dir = File.dirname(__FILE__)
        default_basename = 'app.yml'
        @@config_file = ENV['CONFIG_YML'] || File.join(@@root_dir, default_basename)

        def self.root_dir
            @@root_dir
        end

        def self.fill_in_env
            return unless File.exists?(@@config_file)

            y = YAML.load(File.open(@@config_file)) rescue nil

            return unless y

            y.each do |k, v|
                ENV[k.to_s] ||= v
            end
        end<commit_msg>require yaml -- necessary on some stacks<commit_after>#!/usr/bin/env ruby
# init.rb : set up $LOAD_PATH and provide an easy accessor
# Additionally, use the 'app.yml' file to fill in any variables in ENV
#
require 'yaml'

module RackSkeleton
    class Settings
        @@root_dir = File.dirname(__FILE__)
        default_basename = 'app.yml'
        @@config_file = ENV['CONFIG_YML'] || File.join(@@root_dir, default_basename)

        def self.root_dir
            @@root_dir
        end

        def self.fill_in_env
            return unless File.exists?(@@config_file)

            y = YAML.load(File.open(@@config_file)) rescue nil

            return unless y

            y.each do |k, v|
                ENV[k.to_s] ||= v
            end
        end
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.0, 'mean_word_length': 2.0392561983471076, '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': '4676634', 'n_tokens_mistral': 480, 'n_tokens_neox': 445, 'n_words': 124}