<commit_before>module VagrantPlugins
	module Ghost
		module Ghost
			@@hosts_path = Vagrant::Util::Platform.windows? ? File.expand_path('system32/drivers/etc/hosts', ENV['windir']) : '/etc/hosts'

			def getIps
				ips = []
				@machine.config.vm.networks.each do |network|
					key, options = network[0], network[1]
					ip = options[:ip] if key == :private_network
					ips.push(ip) if ip
				end

				begin
					network = @machine.provider.driver.read_guest_ip
					if network['ip']
						ips.push( network['ip'] ) unless ips.include? network['ip']
					end
				rescue
				end

				return ips
			end

			def getHostnames
				hostnames = Array(@machine.config.vm.hostname)

				# Regenerate hostsfile
				paths = Dir[File.join( 'config', '**', 'hosts' )]
				hosts = paths.map do |path|
					lines = File.readlines(path).map(&:chomp)
					lines.grep(/\A[^#]/)
				end.flatten.uniq

				# Pull in managed aliases
				local = Dir[File.join( '**', 'aliases' )]
				local_hosts = local.map do |path|
					lines = File.readlines(path).map(&:chomp)
					lines.grep(/\A[^#]/)
				end.flatten.uniq

				# Merge our lists together
				aliases = ( hosts << local_hosts ).flatten!

				# Concat with the local hostname
				hostnames.concat( aliases )

				# Update the achine configuration
				if @machine.config.ghost.aliases
					@machine.config.ghost.aliases = aliases
				end

				return hostnames
			end

			def addHostEntries
				ips = getIps
				hostnames = getHostnames
				file = File.open(@@hosts_path, "rb")
				hostsContents = file.read
				uuid = @machine.id
				name = @machine.name<commit_msg>Consoldiate down to just an aliases file<commit_after>module VagrantPlugins
	module Ghost
		module Ghost
			@@hosts_path = Vagrant::Util::Platform.windows? ? File.expand_path('system32/drivers/etc/hosts', ENV['windir']) : '/etc/hosts'

			def getIps
				ips = []
				@machine.config.vm.networks.each do |network|
					key, options = network[0], network[1]
					ip = options[:ip] if key == :private_network
					ips.push(ip) if ip
				end

				begin
					network = @machine.provider.driver.read_guest_ip
					if network['ip']
						ips.push( network['ip'] ) unless ips.include? network['ip']
					end
				rescue
				end

				return ips
			end

			def getHostnames
				hostnames = Array(@machine.config.vm.hostname)

				# Regenerate hostsfile
				paths = Dir[File.join( '**', 'aliases' )]
				aliases = paths.map do |path|
					lines = File.readlines(path).map(&:chomp)
					lines.grep(/\A[^#]/)
				end.flatten.uniq

				# Concat with the local hostname
				hostnames.concat( aliases )

				# Update the achine configuration
				if @machine.config.ghost.aliases
					@machine.config.ghost.aliases = aliases
				end

				return hostnames
			end

			def addHostEntries
				ips = getIps
				hostnames = getHostnames
				file = File.open(@@hosts_path, "rb")
				hostsContents = file.read
				uuid = @machine.id
				name = @machine.name
{'fraction_non_alphanumeric': 0.12559726962457338, 'fraction_numerical': 0.0027303754266211604, 'mean_word_length': 2.8064935064935064, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7360573', 'n_tokens_mistral': 1296, 'n_tokens_neox': 974, 'n_words': 223}