<commit_before>plugin_root = File.join(File.dirname(__FILE__), '..')

require 'rubygems'
gem 'rails'
require 'activerecord'
require 'active_support'
require 'action_controller'
require 'action_view'

$:.unshift "#{plugin_root}/lib"

RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/../')
Rails::Initializer.run(:set_load_path)
Rails::Initializer.run(:set_autoload_paths)

require File.join(File.dirname(__FILE__), '/../init.rb')

FileUtils.mkdir_p File.join(File.dirname(__FILE__), 'log')
ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), 'log', 'spec.log'))

databases = YAML::load(IO.read(File.join(File.dirname(__FILE__), 'db', 'database.yml')))
ActiveRecord::Base.establish_connection(databases['postgresql'])
load(File.join(File.dirname(__FILE__), 'db', 'schema.rb'))<commit_msg>specs should run against SQLite by default<commit_after>plugin_root = File.join(File.dirname(__FILE__), '..')

require 'rubygems'
gem 'rails'
require 'activerecord'
require 'active_support'
require 'action_controller'
require 'action_view'

$:.unshift "#{plugin_root}/lib"

RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/../')
Rails::Initializer.run(:set_load_path)
Rails::Initializer.run(:set_autoload_paths)

require File.join(File.dirname(__FILE__), '/../init.rb')

FileUtils.mkdir_p File.join(File.dirname(__FILE__), 'log')
ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), 'log', 'spec.log'))

databases = YAML::load(IO.read(File.join(File.dirname(__FILE__), 'db', 'database.yml')))
ActiveRecord::Base.establish_connection(databases['sqlite3'])
load(File.join(File.dirname(__FILE__), 'db', 'schema.rb'))
{'fraction_non_alphanumeric': 0.1823671497584541, 'fraction_numerical': 0.0006038647342995169, 'mean_word_length': 8.154696132596685, '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': '4840285', 'n_tokens_mistral': 587, 'n_tokens_neox': 572, 'n_words': 81}