<commit_before>require 'closer'
require 'rails'
require 'daddy/cucumber/helpers'
require 'capybara/cucumber'
require 'capybara/poltergeist' if ENV['DRIVER'] == 'poltergeist'

Capybara.default_driver = (ENV['DRIVER'] || :selenium).to_sym
Capybara.default_selector = :css

include HyaccConstants

if ENV['CI'] != 'travis'
  Before do |scenario|
    feature_file = scenario.feature.location.file
    dump_dir = File.join('tmp', File.dirname(feature_file), File.basename(feature_file, '.feature'))
  
    if ARGV.include?(feature_file)
      db = Dir.glob(File.join(dump_dir, '*.dump.gz')).first
      if db
        system("rake dad:db:load DUMP_FILE=#{db} --quiet")
      end
    else
      # 直前のDBをダンプしておく
      if @current_feature != feature_file
        system("rm -Rf #{dump_dir}")
        system("rake dad:db:dump DUMP_DIR=#{dump_dir} --quiet")
        @current_feature = feature_file
      end
    end
  
    resize_window(1280, 720)<commit_msg>cucumber-rails<commit_after>require 'closer'

begin
  require 'cucumber/rails'
  Cucumber::Rails::Database.autorun_database_cleaner = false
rescue LoadError => e
  puts 'cucumber-rails not found.'
end

require 'daddy/cucumber'

include HyaccConstants

if ENV['CI'] != 'travis'
  Before do |scenario|
    feature_file = scenario.feature.location.file
    dump_dir = File.join('tmp', File.dirname(feature_file), File.basename(feature_file, '.feature'))

    if ARGV.include?(feature_file)
      db = Dir.glob(File.join(dump_dir, '*.dump.gz')).first
      if db
        system("bundle exec rake dad:db:load DUMP_FILE=#{db} --quiet")
      end
    else
      # 直前のDBをダンプしておく
      if @current_feature != feature_file
        system("rm -Rf #{dump_dir}")
        system("bundle exec rake dad:db:dump DUMP_DIR=#{dump_dir} --quiet")
        @current_feature = feature_file
      end
    end

    resize_window(1280, 720)
{'fraction_non_alphanumeric': 0.1321869962385814, 'fraction_numerical': 0.007522837184309511, 'mean_word_length': 3.586206896551724, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4483803', 'n_tokens_mistral': 680, 'n_tokens_neox': 660, 'n_words': 128}