<commit_before>
RSpec.configure do |config|
  
  def run_command(string)
    name, *args = string.split(' ')
    CLITester.new(name, args)
  end
  
  # Capture a certain io stream for anything run within the block
  #
  # Example:  output = capture('stdout') { puts 'hello world' }
  def capture(stream)
    capture_with_status(stream){ yield }[0]
  end
  
  # Capture both io stream and exit status
  #
  # Example:  output, exit_status = capture('stdout') { puts 'hello world' }
  def capture_with_status(stream)
    exit_status = 0
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      begin
        yield<commit_msg>Add helper comment.<commit_after>
RSpec.configure do |config|
  
  # run a CLI command - returned object is a CLITester instance, can be mined for output
  def run_command(string)
    name, *args = string.split(' ')
    CLITester.new(name, args)
  end
  
  # Capture a certain io stream for anything run within the block
  #
  # Example:  output = capture('stdout') { puts 'hello world' }
  def capture(stream)
    capture_with_status(stream){ yield }[0]
  end
  
  # Capture both io stream and exit status
  #
  # Example:  output, exit_status = capture('stdout') { puts 'hello world' }
  def capture_with_status(stream)
    exit_status = 0
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      begin
        yield
{'fraction_non_alphanumeric': 0.100647016534867, 'fraction_numerical': 0.002875629043853343, 'mean_word_length': 3.023121387283237, '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': '612696', 'n_tokens_mistral': 443, 'n_tokens_neox': 441, 'n_words': 138}