<commit_before>require 'rubygems'
require 'bundler'

begin
  Bundler.setup(:runtime, :test)
rescue Bundler::BundlerError => e
  STDERR.puts e.message
  STDERR.puts "Run `bundle install` to install missing gems"
  exit e.status_code
end

require 'spec'
require 'dm-core/spec/lib/spec_helper'
require 'dm-core/spec/lib/adapter_helpers'

ENV['ADAPTERS'] ||= 'sqlite3'

# create sqlite3_fs directory if it doesn't exist
temp_db_dir = Pathname(File.expand_path('../db', __FILE__))
temp_db_dir.mkpath

DataMapper::Spec::AdapterHelpers.temp_db_dir = temp_db_dir

adapters = ENV['ADAPTERS'].split(/\s+/).map { |adapter_name| adapter_name.downcase }.uniq
adapters = DataMapper::Spec::AdapterHelpers.primary_adapters.keys if adapters.include?('all')

DataMapper::Spec::AdapterHelpers.setup_adapters(adapters)

Spec::Runner.configure do |config|
  config.extend(DataMapper::Spec::AdapterHelpers)

  config.after :all do
    DataMapper::Spec.cleanup_models<commit_msg>Require 'dm-is-read_only'.<commit_after>require 'rubygems'
require 'bundler'

begin
  Bundler.setup(:runtime, :test)
rescue Bundler::BundlerError => e
  STDERR.puts e.message
  STDERR.puts "Run `bundle install` to install missing gems"
  exit e.status_code
end

require 'spec'
require 'dm-core/spec/lib/spec_helper'
require 'dm-core/spec/lib/adapter_helpers'

require 'dm-is-read_only'

ENV['ADAPTERS'] ||= 'sqlite3'

# create sqlite3_fs directory if it doesn't exist
temp_db_dir = Pathname(File.expand_path('../db', __FILE__))
temp_db_dir.mkpath

DataMapper::Spec::AdapterHelpers.temp_db_dir = temp_db_dir

adapters = ENV['ADAPTERS'].split(/\s+/).map { |adapter_name| adapter_name.downcase }.uniq
adapters = DataMapper::Spec::AdapterHelpers.primary_adapters.keys if adapters.include?('all')

DataMapper::Spec::AdapterHelpers.setup_adapters(adapters)

Spec::Runner.configure do |config|
  config.extend(DataMapper::Spec::AdapterHelpers)

  config.after :all do
    DataMapper::Spec.cleanup_models
{'fraction_non_alphanumeric': 0.13268442622950818, 'fraction_numerical': 0.0020491803278688526, 'mean_word_length': 6.342105263157895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5406263', 'n_tokens_mistral': 700, 'n_tokens_neox': 685, 'n_words': 126}