<commit_before>require 'rubygems'

if defined?(RSpec)
  begin
    require 'rspec/expectations'
  rescue LoadError
    nil
  end
end

if ENV['COVERAGE']
  require File.join(File.dirname(File.expand_path(__FILE__)), "../sequel_coverage")
  SimpleCov.sequel_coverage(:filter=>%r{lib/sequel/(extensions|plugins)/\w+\.rb\z})
end

unless Object.const_defined?('Sequel') && Sequel.const_defined?('Model')
  $:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), "../../lib/"))
  require 'sequel/no_core_ext'
end

begin
  # Attempt to load ActiveSupport inflector first, so Sequel inflector
  # can override it.
  require 'active_support/inflector'
  require 'active_support/core_ext/string/inflections'
rescue LoadError
  nil
end

Sequel.extension :meta_def

# Load core_refinements extension first, so pg_* extensions add their own refinements
Sequel.extension :core_refinements if RUBY_VERSION >= '2.0.0'<commit_msg>Load the ActiveSupport blank extension first when running extension tests<commit_after>require 'rubygems'

if defined?(RSpec)
  begin
    require 'rspec/expectations'
  rescue LoadError
    nil
  end
end

if ENV['COVERAGE']
  require File.join(File.dirname(File.expand_path(__FILE__)), "../sequel_coverage")
  SimpleCov.sequel_coverage(:filter=>%r{lib/sequel/(extensions|plugins)/\w+\.rb\z})
end

unless Object.const_defined?('Sequel') && Sequel.const_defined?('Model')
  $:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), "../../lib/"))
  require 'sequel/no_core_ext'
end

begin
  # Attempt to load ActiveSupport blank extension and inflector first, so Sequel
  # can override them.
  require 'active_support/core_ext/object/blank'
  require 'active_support/inflector'
  require 'active_support/core_ext/string/inflections'
rescue LoadError
  nil
end

Sequel.extension :meta_def

# Load core_refinements extension first, so pg_* extensions add their own refinements
Sequel.extension :core_refinements if RUBY_VERSION >= '2.0.0'
{'fraction_non_alphanumeric': 0.12098009188361408, 'fraction_numerical': 0.0030627871362940277, 'mean_word_length': 5.302250803858521, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2738046', 'n_tokens_mistral': 654, 'n_tokens_neox': 652, 'n_words': 144}