<commit_before>ActiveRecord::Base.configurations = {
  "postgresql" => {
    "adapter" => 'postgresql',
    "host" => 'localhost',
    "database" => 'relation_to_struct_tests',
    "encoding" => 'utf8',
    "username" => 'jcoleman',
  },
  "sqlite" => {
    "adapter"  => "sqlite3",
    "database" => ":memory:",
  },
}

env = ENV['DATABASE'] ||= 'sqlite'
config = ActiveRecord::Base.configurations[env]

case env
when 'postgresql'
  ActiveRecord::Tasks::DatabaseTasks.instance_variable_set('@env', env)
  ActiveRecord::Tasks::DatabaseTasks.drop_current
  ActiveRecord::Tasks::DatabaseTasks.create_current
  ActiveRecord::Tasks::DatabaseTasks.load_schema_current(:ruby, File.expand_path('../schema.rb', __FILE__))
  ActiveRecord::Base.establish_connection(config)
when 'sqlite'
  ActiveRecord::Base.establish_connection(config)
  require_relative 'schema'
else
  raise ArgumentError, 'Unrecognized ENV["DATABASE"] argument.'
end

require_relative 'economic_school'
require_relative 'economist'
<commit_msg>Load Postgres username/password from environment to support CI. (#5)<commit_after>ActiveRecord::Base.configurations = {
  "postgresql" => {
    "adapter" => 'postgresql',
    "host" => 'localhost',
    "database" => 'relation_to_struct_tests',
    "encoding" => 'utf8',
    "username" => ENV["DATABASE_POSTGRESQL_USERNAME"] || `whoami`.strip,
    "password" => ENV["<PASSWORD>"],
  },
  "sqlite" => {
    "adapter"  => "sqlite3",
    "database" => ":memory:",
  },
}

env = ENV['DATABASE'] ||= 'sqlite'
config = ActiveRecord::Base.configurations[env]

case env
when 'postgresql'
  ActiveRecord::Tasks::DatabaseTasks.instance_variable_set('@env', env)
  ActiveRecord::Tasks::DatabaseTasks.drop_current
  ActiveRecord::Tasks::DatabaseTasks.create_current
  ActiveRecord::Tasks::DatabaseTasks.load_schema_current(:ruby, File.expand_path('../schema.rb', __FILE__))
  ActiveRecord::Base.establish_connection(config)
when 'sqlite'
  ActiveRecord::Base.establish_connection(config)
  require_relative 'schema'
else
  raise ArgumentError, 'Unrecognized ENV["DATABASE"] argument.'
end

require_relative 'economic_school'
require_relative 'economist'

{'fraction_non_alphanumeric': 0.15789473684210525, 'fraction_numerical': 0.002328830926874709, 'mean_word_length': 6.183946488294314, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 23, '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': '4534835', 'n_tokens_mistral': 700, 'n_tokens_neox': 686, 'n_words': 111}