<commit_before>ROOT_DIR = File.expand_path(File.dirname(__FILE__)) unless defined? ROOT_DIR

require "rubygems"

begin
  require "vendor/dependencies-0.0.9/lib/dependencies"
rescue LoadError
  require "dependencies"
end

require "monk/glue"
require 'sass'
require 'active_support'
require 'active_record'
require 'mustache/sinatra'

log = File.new("log/sinatra.log", "a+")
STDOUT.reopen(log)
STDERR.reopen(log)

class Main < Monk::Glue
  set :app_file, __FILE__
  use Rack::Session::Cookie
  if RACK_ENV.to_sym == :production
    use Rack::Auth::Basic do |username, password|
      username == monk_settings(:http_auth_username) && password == <PASSWORD>settings(:http_auth_password)
    end
  end
  register Mustache::Sinatra
  set :views, root_path('app', 'templates')
  set :mustache, {
    :templates => root_path('app', 'templates'),
    :views => root_path('app', 'views')
  }
  set :raise_errors, true
  set :show_exceptions

  configure do
    # Set up ActiveRecord
    @db_config = YAML.load(File.open('config/database.yml'))
    ActiveRecord::Base.configurations = @db_config
    ActiveRecord::Base.establish_connection(@db_config[Main.environment.to_s])

    # Load all application files.
    Dir[root_path("app/**/*.rb")].each do |file|
      require file
    end
  end
end

Main.run! if Main.run?<commit_msg>Fix requires<commit_after>ROOT_DIR = File.expand_path(File.dirname(__FILE__)) unless defined? ROOT_DIR

require "rubygems"

begin
  require "vendor/dependencies-0.0.9/lib/dependencies"
rescue LoadError
  require "dependencies"
end

require "monk/glue"
require 'sass'
require 'active_support'
require 'active_record'
require 'mustache/sinatra'

log = File.new("log/sinatra.log", "a+")
STDOUT.reopen(log)
STDERR.reopen(log)

class Main < Monk::Glue
  set :app_file, __FILE__
  use Rack::Session::Cookie
  if RACK_ENV.to_sym == :production
    use Rack::Auth::Basic do |username, password|
      username == monk_settings(:http_auth_username) && password == monk_settings(:http_auth_password)
    end
  end
  register Mustache::Sinatra
  set :views, root_path('app', 'templates')
  set :mustache, {
    :templates => root_path('app', 'templates'),
    :views => root_path('app', 'views')
  }
  set :raise_errors, true
  set :show_exceptions

  configure do
    # Set up ActiveRecord
    @db_config = YAML.load(File.open('config/database.yml'))
    ActiveRecord::Base.configurations = @db_config
    ActiveRecord::Base.establish_connection(@db_config[Main.environment.to_s])

    # Load all application files.
    Dir[root_path("app/helpers/**/*.rb")].each do |file|
      require file
    end
    Dir[root_path("app/**/*.rb")].each do |file|
      require file
    end
  end
end

Main.run! if Main.run?
{'fraction_non_alphanumeric': 0.1338235294117647, 'fraction_numerical': 0.0022058823529411764, 'mean_word_length': 4.519269776876268, 'pattern_counts': {'":': 0, '<': 6, '<?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': '6209544', 'n_tokens_mistral': 942, 'n_tokens_neox': 917, 'n_words': 198}