<commit_before>require "vagrant"

module Conjure
  class Instance
    def initialize
      config_path = File.expand_path "../../../config", __FILE__
      @vagrant = Vagrant::Environment.new :cwd => config_path
      install_base_image
      start_vm
      issue_test_command
    end

    def install_base_image
      unless @vagrant.boxes.find "precise64"
        puts "Downloading 300MB Ubuntu base image for Vagrant, this may take a few minutes..."
        @vagrant.boxes.add "precise64", "http://files.vagrantup.com/precise64.box"
      end
    end

    def start_vm
      unless @vagrant.primary_vm.state == :running
        puts "Starting a VM..."
        @vagrant.primary_vm.up
      end
    end

    def issue_test_command
      puts "Sending the VM a command..."
      @vagrant.primary_vm.channel.execute "uname -mrs" do |device, data|
        puts "OS info reported by the VM: #{data}"
      end
    end
  end
end
<commit_msg>Begin to generalize for multiple Vagrant VMs<commit_after>require "vagrant"

module Conjure
  class Instance
    def initialize
      config_path = File.expand_path "../../../config", __FILE__
      @vagrant = Vagrant::Environment.new :cwd => config_path
      install_base_image
      @vm = @vagrant.primary_vm
      start_vm
      issue_test_command
    end

    def install_base_image
      unless @vagrant.boxes.find "precise64"
        puts "Downloading 300MB Ubuntu base image for Vagrant, this may take a few minutes..."
        @vagrant.boxes.add "precise64", "http://files.vagrantup.com/precise64.box"
      end
    end

    def start_vm
      unless @vm.state == :running
        puts "Starting a VM..."
        @vm.up
      end
    end

    def issue_test_command
      puts "Sending the VM a command..."
      @vm.channel.execute "uname -mrs" do |device, data|
        puts "OS info reported by the VM: #{data}"
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.09370037056643726, 'fraction_numerical': 0.009528851244044468, 'mean_word_length': 2.3392226148409896, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1271622', 'n_tokens_mistral': 622, 'n_tokens_neox': 606, 'n_words': 172}