<commit_before>require 'serverspec'

def windows?
  !(RUBY_PLATFORM =~ /mswin|mingw32|windows/).nil?
end

def wmi
  @wmi ||= WmiLite::Wmi.new
end

def net_adapters
  @adapters ||= wmi.instances_of('Win32_NetworkAdapter')
end

def debian?
  File.exist? '/etc/debian_version'
end

def rhel?
  File.exist? '/etc/redhat-release'
end

def install_wmi
  puts 'Installing WMI gem?'
  `#{Gem.bindir}/bundle install --gemfile #{File.join(File.dirname(__FILE__), 'Gemfile')}`
  Gem.clear_paths
end

def load_wmi
  puts 'Loading WMI gem?'
  begin
    gem 'wmi-lite'
  rescue LoadError
    install_wmi
  end

  require 'wmi-lite'
end

def win_interface(name)
  net_adapters.find { |n| n['netconnectionid'] == name }
end

# NIX?
set :backend, :exec unless windows?

# Windows
load_wmi if windows?
set :backend, :cmd if windows?
set :os, :family => 'windows' if windows?
<commit_msg>Update stdout messages<commit_after>require 'serverspec'

def windows?
  !(RUBY_PLATFORM =~ /mswin|mingw32|windows/).nil?
end

def wmi
  @wmi ||= WmiLite::Wmi.new
end

def net_adapters
  @adapters ||= wmi.instances_of('Win32_NetworkAdapter')
end

def debian?
  File.exist? '/etc/debian_version'
end

def rhel?
  File.exist? '/etc/redhat-release'
end

def install_wmi
  puts 'Installing wmi-lite gem'
  `#{Gem.bindir}/bundle install --gemfile #{File.join(File.dirname(__FILE__), 'Gemfile')}`
  Gem.clear_paths
end

def load_wmi
  puts 'Loading wmi-lite gem'
  begin
    gem 'wmi-lite'
  rescue LoadError
    install_wmi
  end

  require 'wmi-lite'
end

def win_interface(name)
  net_adapters.find { |n| n['netconnectionid'] == name }
end

# NIX?
set :backend, :exec unless windows?

# Windows
load_wmi if windows?
set :backend, :cmd if windows?
set :os, :family => 'windows' if windows?

{'fraction_non_alphanumeric': 0.13105413105413105, 'fraction_numerical': 0.004558404558404558, 'mean_word_length': 4.3373860182370825, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3308531', 'n_tokens_mistral': 702, 'n_tokens_neox': 693, 'n_words': 170}