<commit_before>require 'rubygems'
require 'rack/test'
require 'test/unit'
require 'shoulda'
require 'mocha'
require 'fileutils'

dir = File.dirname(File.expand_path(__FILE__))
$LOAD_PATH.unshift(File.join(dir, '..', 'lib'))
$LOAD_PATH.unshift(dir)

ENV['RACK_ENV'] = 'test'
require 'gollum'
require 'gollum/frontend/app'

# Make sure we're in the test dir, the tests expect that to be the current
# directory.
TEST_DIR = File.join(File.dirname(__FILE__), *%w[.])

def testpath(path)
  File.join(TEST_DIR, path)
end

def cloned_testpath(path)
  repo   = File.expand_path(testpath(path))
  path   = File.dirname(repo)
  cloned = File.join(path, self.class.name)
  FileUtils.rm_rf(cloned)
  Dir.chdir(path) do
    %x{git clone #{File.basename(repo)} #{self.class.name}}
  end
  cloned
end

def commit_details
  { :message => "Did something at #{Time.now}",
    :name    => "<NAME>",
    :email   => "<EMAIL>" }<commit_msg>Hush test clone warnings<commit_after>require 'rubygems'
require 'rack/test'
require 'test/unit'
require 'shoulda'
require 'mocha'
require 'fileutils'

dir = File.dirname(File.expand_path(__FILE__))
$LOAD_PATH.unshift(File.join(dir, '..', 'lib'))
$LOAD_PATH.unshift(dir)

ENV['RACK_ENV'] = 'test'
require 'gollum'
require 'gollum/frontend/app'

# Make sure we're in the test dir, the tests expect that to be the current
# directory.
TEST_DIR = File.join(File.dirname(__FILE__), *%w[.])

def testpath(path)
  File.join(TEST_DIR, path)
end

def cloned_testpath(path)
  repo   = File.expand_path(testpath(path))
  path   = File.dirname(repo)
  cloned = File.join(path, self.class.name)
  FileUtils.rm_rf(cloned)
  Dir.chdir(path) do
    %x{git clone #{File.basename(repo)} #{self.class.name} 2>/dev/null}
  end
  cloned
end

def commit_details
  { :message => "Did something at #{Time.now}",
    :name    => "<NAME>",
    :email   => "<EMAIL>" }
{'fraction_non_alphanumeric': 0.15851692638366469, 'fraction_numerical': 0.0005373455131649651, 'mean_word_length': 4.625377643504532, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, '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': '2828830', 'n_tokens_mistral': 706, 'n_tokens_neox': 696, 'n_words': 158}