<commit_before>#!/usr/bin/ruby -w
# -*- ruby -*-

require 'logue/loggable'
require 'system/command/line'
require 'system/command/caching'
require 'svnx/base/env'

module Svnx
  module Base
  end
end

class Svnx::CachingCommandLine < System::CachingCommandLine
  def caching?
    true
  end

  def cache_dir
    Svnx::Env.instance.cache_dir
  end
end

class Svnx::Base::CommandLine
  include Logue::Loggable

  attr_reader :output
  attr_reader :error
  attr_reader :status  

  def initialize subcommand: nil, xml: true, caching: false, args: Array.new
    @subcommand = subcommand
    @xml = xml
    @caching = caching
    @args = args
  end

  def execute
    cmdargs = [ 'svn', @subcommand ]
    cmdargs << '--xml' if @xml
    cmdargs.concat @args
    debug "cmdargs: #{cmdargs}"
    
    cmdline = if @caching
                Svnx::CachingCommandLine.new cmdargs
              else
                System::CommandLine.new cmdargs
              end
    cmdline.execute
    info "cmdline: #{cmdline}"
      <commit_msg>Insert Base module into CachingCommandLine name<commit_after>#!/usr/bin/ruby -w
# -*- ruby -*-

require 'logue/loggable'
require 'system/command/line'
require 'system/command/caching'
require 'svnx/base/env'

module Svnx
  module Base
  end
end

class Svnx::Base::CachingCommandLine < System::CachingCommandLine
  def caching?
    true
  end

  def cache_dir
    Svnx::Env.instance.cache_dir
  end
end

class Svnx::Base::CommandLine
  include Logue::Loggable

  attr_reader :output
  attr_reader :error
  attr_reader :status  

  def initialize subcommand: nil, xml: true, caching: false, args: Array.new
    @subcommand = subcommand
    @xml = xml
    @caching = caching
    @args = args
  end

  def execute
    cmdargs = [ 'svn', @subcommand ]
    cmdargs << '--xml' if @xml
    cmdargs.concat @args
    debug "cmdargs: #{cmdargs}"
    
    cmdline = if @caching
                Svnx::Base::CachingCommandLine.new cmdargs
              else
                System::CommandLine.new cmdargs
              end
    cmdline.execute
    info "cmdline: #{cmdline}"
      
{'fraction_non_alphanumeric': 0.10057471264367816, 'fraction_numerical': 0.0, 'mean_word_length': 2.6778169014084505, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '5490777', 'n_tokens_mistral': 693, 'n_tokens_neox': 678, 'n_words': 175}