<commit_before>begin
  require 'active_record'
rescue LoadError
  abort "ActiveRecord requires the rails appraisal. Try `appraisal cucumber`"
end

module Eaco
  module Cucumber

    ##
    # +ActiveRecord+ configuration and connection.
    #
    # Uses features/support/active_record.yml by default, overridable via the
    # +EACO_AR_CONFIG+ environment variable.
    #
    module ActiveRecord
      ##
      # Set up ActiveRecord
      #
      # @return [Class] +ActiveRecord::Base+
      #
      def active_record
        @_active_record ||= ::ActiveRecord::Base.tap do |active_record|
          active_record.logger = ::Logger.new(active_record_log).tap {|l| l.level = 0}
        end
      end

      ##
      # Log to stderr if VERBOSE is given, else log to
      # features/active_record.log
      #
      # @return [IO] the log destination
      #
      def active_record_log
        @_active_record_log ||= ENV['VERBOSE'].present? ? $stderr :
          'features/active_record.log'.tap {|f| File.open(f, "w+")}
      end

      ##
      # @return [Logger] the logger configured, logging to {.active_record_log}.
      #
      def logger
        active_record.logger
      end

      ##
      # @return [ActiveRecord::Connection] the current +ActiveRecord+ connection<commit_msg>Minor docs and paths fix<commit_after>begin
  require 'active_record'
rescue LoadError
  abort "ActiveRecord requires the rails appraisal. Try `appraisal cucumber`"
end

module Eaco
  module Cucumber

    ##
    # +ActiveRecord+ configuration and connection.
    #
    # Database configuration is looked up in +features/support/active_record.yml+,
    # logs to +features/support/active_record.log+, truncating the file at each run.
    #
    # Environment variables:
    #
    # * +EACO_AR_CONFIG+ specify a different +ActiveRecord+ configuration file
    # * +VERBOSE+ log to +stderr+
    #
    module ActiveRecord
      ##
      # Looks up ActiveRecord and sets the +logger+.
      #
      # @return [Class] +ActiveRecord::Base+
      #
      def active_record
        @_active_record ||= ::ActiveRecord::Base.tap do |active_record|
          active_record.logger = ::Logger.new(active_record_log).tap {|l| l.level = 0}
        end
      end

      ##
      # Log to stderr if +VERBOSE+ is given, else log to
      # +features/support/active_record.log+
      #
      # @return [IO] the log destination
      #
      def active_record_log
        @_active_record_log ||= ENV['VERBOSE'].present? ? $stderr :
          'features/support/active_record.log'.tap {|f| File.open(f, "w+")}
      end

      ##
      # @return [Logger] the logger configured, logging to {.active_record_log}.
      #
      def logger
        active_record.logger
      end

      ##
      # @return [ActiveRecord::Connection] the current +ActiveRecord+ connection
{'fraction_non_alphanumeric': 0.10293597453130528, 'fraction_numerical': 0.0007074637424831977, 'mean_word_length': 2.539424280350438, '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': '4802772', 'n_tokens_mistral': 871, 'n_tokens_neox': 840, 'n_words': 222}