<commit_before>begin
	FileUtils
rescue NameError
	require 'FileUtils'
end
require 'pp'

begin
	require 'vagrant'
rescue LoadError
	raise 'The Vagrant SparseImage plugin must be run within Vagrant.'
end

module SparseImage
	VERSION = "0.1.2"

	class ImageConfig
		# Configuration for a single sparse image
		# Not exposed to vagrant.

		attr_accessor :vm_mountpoint, :image_size, :image_fs, :image_type, :volume_name, :image_folder, :auto_unmount
		
		@@required = [
			:volume_name,
			:image_type,
			:image_fs,
			:vm_mountpoint,
			:image_size,
			:image_folder ]

		@@valid_image_types = ["SPARSEIMAGE", "SPARSEBUNDLE"]

		def validate
			errors = []
			# Check for the required config keys
			@@required.each do |key|
				if not to_hash[key] or (to_hash[key].is_a? String  and to_hash[key].length == 0)
					puts to_hash
					errors.push "#{key} must be present."
				end
			end

			# Validate image type
			if not @@valid_image_types.include?(@image_type)
				errors.push "image_type: invalid value: only supports #{@@valid_image_types.join(',')}"
			end

			# Size must be an int
			if @image_size and not @image_size.is_a? Fixnum
				errors.push "image_size: Must be a number."
			end
			{ "vagrant-sparseimage" => errors }
		end

		def finalize!
			if @auto_unmount.nil?
				@auto_unmount = true
			end
		end

		def to_hash
			{	:vm_mountpoint   => @vm_mountpoint,
				:image_filename  => @image_filename,
				:image_size      => @image_size,
				:image_fs        => @image_fs,
				:image_type      => @image_type,
				:image_folder	 => @image_folder }
		end
	end

	class Mount
		# Mount sparse images on the host machine and add them to the config for the guest
		# Create the sparse image files if necessary.

		def initialize(app, env)
			@app = app
			@env = env
		end<commit_msg>[FIX] to_hash for settings was missing a property.<commit_after>begin
	FileUtils
rescue NameError
	require 'FileUtils'
end
require 'pp'

begin
	require 'vagrant'
rescue LoadError
	raise 'The Vagrant SparseImage plugin must be run within Vagrant.'
end

module SparseImage
	VERSION = "0.1.2"

	class ImageConfig
		# Configuration for a single sparse image
		# Not exposed to vagrant.

		attr_accessor :vm_mountpoint, :image_size, :image_fs, :image_type, :volume_name, :image_folder, :auto_unmount
		
		@@required = [
			:volume_name,
			:image_type,
			:image_fs,
			:vm_mountpoint,
			:image_size,
			:image_folder ]

		@@valid_image_types = ["SPARSEIMAGE", "SPARSEBUNDLE"]

		def validate
			errors = []
			# Check for the required config keys
			@@required.each do |key|
				if not to_hash[key] or (to_hash[key].is_a? String  and to_hash[key].length == 0)
					puts to_hash
					errors.push "#{key} must be present."
				end
			end

			# Validate image type
			if not @@valid_image_types.include?(@image_type)
				errors.push "image_type: invalid value: only supports #{@@valid_image_types.join(',')}"
			end

			# Size must be an int
			if @image_size and not @image_size.is_a? Fixnum
				errors.push "image_size: Must be a number."
			end
			{ "vagrant-sparseimage" => errors }
		end

		def finalize!
			if @auto_unmount.nil?
				@auto_unmount = true
			end
		end

		def to_hash
			{	:vm_mountpoint  => @vm_mountpoint,
				:image_size     => @image_size,
				:image_fs       => @image_fs,
				:image_type     => @image_type,
				:volume_name	=> @volume_name,
				:auto_unmount	=> @auto_unmount,
				:image_folder	=> @image_folder }
		end
	end

	class Mount
		# Mount sparse images on the host machine and add them to the config for the guest
		# Create the sparse image files if necessary.

		def initialize(app, env)
			@app = app
			@env = env
		end
{'fraction_non_alphanumeric': 0.09871126953660543, 'fraction_numerical': 0.0021935837674801205, 'mean_word_length': 3.3120567375886525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '328250', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1261, 'n_words': 370}