<commit_before>require File.dirname(__FILE__) + '/../lib/nanoc.rb'

def in_dir(a_path)
  FileUtils.cd(File.join(a_path))
  yield
ensure
  FileUtils.cd(File.join(a_path.map { |n| '..' }))
end

def with_site_fixture(a_fixture)
  in_dir(['test', 'fixtures', a_fixture]) do
    yield(Nanoc::Site.from_cwd)
  end
end

def test_require(s)
  require s
  true
rescue LoadError
  $stderr.print "[ WARNING: #{s} not installed -- cannot test ]"
  false
end<commit_msg>removing test_require method since it is not used anywhere anymore<commit_after>require File.dirname(__FILE__) + '/../lib/nanoc.rb'

def in_dir(a_path)
  FileUtils.cd(File.join(a_path))
  yield
ensure
  FileUtils.cd(File.join(a_path.map { |n| '..' }))
end

def with_site_fixture(a_fixture)
  in_dir(['test', 'fixtures', a_fixture]) do
    yield(Nanoc::Site.from_cwd)
  end
end
{'fraction_non_alphanumeric': 0.148859543817527, 'fraction_numerical': 0.0, 'mean_word_length': 4.597315436241611, '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': '4077767', 'n_tokens_mistral': 331, 'n_tokens_neox': 327, 'n_words': 65}