<commit_before># encoding: utf-8
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/spec')
$LOAD_PATH.unshift(File.dirname(__FILE__))

gem "minitest"
require "minitest/spec"
require "minitest/autorun"
require "minitest/matchers"
require "minitest/pride"
require "mocha"
require "pry"

require "skiima"

SKIIMA_ROOT = File.dirname(__FILE__)

Skiima.setup do |config|
  config.root_path = SKIIMA_ROOT
  config.config_path = 'config'
  config.scripts_path = 'db/skiima'
  config.locale = :en
end

def ensure_closed(s, &block)
  yield s
ensure
  s.connection.close
end

def within_transaction(s, &block)
  s.connection.begin_db_transaction
  yield s
ensure
  s.connection.rollback_db_transaction
end<commit_msg>Spec Helper: require active_record gemset<commit_after># encoding: utf-8
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/spec')
$LOAD_PATH.unshift(File.dirname(__FILE__))

gem "minitest"
require "minitest/spec"
require "minitest/autorun"
require "minitest/matchers"
require "minitest/pride"
require "mocha"
require "pry"

Bundler.require(:active_record)

require "skiima"

SKIIMA_ROOT = File.dirname(__FILE__)

Skiima.setup do |config|
  config.root_path = SKIIMA_ROOT
  config.config_path = 'config'
  config.scripts_path = 'db/skiima'
  config.locale = :en
end

def ensure_closed(s, &block)
  yield s
ensure
  s.connector.adapter.close
end

def within_transaction(s, &block)
  s.connector.adapter.begin_db_transaction
  yield s
ensure
  s.connector.adapter.rollback_db_transaction
end
{'fraction_non_alphanumeric': 0.1117092866756393, 'fraction_numerical': 0.0013458950201884253, 'mean_word_length': 5.728506787330317, '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': '4375614', 'n_tokens_mistral': 546, 'n_tokens_neox': 545, 'n_words': 110}