<commit_before>require 'rubygems'
require 'pathname'

module ROXML
  SILENCE_XML_NAME_WARNING = true
end

DIR = Pathname.new(__FILE__ + '../..').expand_path.dirname
LOAD_PATH = DIR.join('lib').to_s
$LOAD_PATH.unshift(LOAD_PATH) unless
  $LOAD_PATH.include?(LOAD_PATH) || $LOAD_PATH.include?(File.expand_path(LOAD_PATH))
require 'roxml'

require File.join(File.dirname(__FILE__), 'shared_specs')

def example(name)
  DIR.join("examples/#{name}.rb")
end

def fixture(name)
  File.read(fixture_path(name))
end

def xml_fixture(name)
  ROXML::XML::Parser.parse_file(fixture_path(name)).root
end
<commit_msg>Only include shared specs when rspec is defined, so we can use spec_helpers for the examples as well<commit_after>require 'rubygems'
require 'pathname'

module ROXML
  SILENCE_XML_NAME_WARNING = true
end

DIR = Pathname.new(__FILE__ + '../..').expand_path.dirname
LOAD_PATH = DIR.join('lib').to_s
$LOAD_PATH.unshift(LOAD_PATH) unless
  $LOAD_PATH.include?(LOAD_PATH) || $LOAD_PATH.include?(File.expand_path(LOAD_PATH))
require 'roxml'

if defined?(Spec)
  require File.join(File.dirname(__FILE__), 'shared_specs')
end

def example(name)
  DIR.join("examples/#{name}.rb")
end

def fixture(name)
  File.read(fixture_path(name))
end

def xml_fixture(name)
  ROXML::XML::Parser.parse_file(fixture_path(name)).root
end

{'fraction_non_alphanumeric': 0.13971146545178437, 'fraction_numerical': 0.0, 'mean_word_length': 6.363128491620111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '2805932', 'n_tokens_mistral': 484, 'n_tokens_neox': 486, 'n_words': 90}