From 0bd0752bf2e246429fc0a97cb16b9ee494ee20d3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 18 Jan 2013 11:37:49 -0800 Subject: [PATCH] Environment#data_dir This is basically a directory to store state. --- lib/vagrant/environment.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 9f9276795..edc7c35b7 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -26,6 +26,13 @@ module Vagrant # The `cwd` that this environment represents attr_reader :cwd + # The persistent data directory where global data can be stored. It + # is up to the creator of the data in this directory to properly + # remove it when it is no longer needed. + # + # @return [Pathname] + attr_reader :data_dir + # The valid name for a Vagrantfile for this environment. attr_reader :vagrantfile_name @@ -101,9 +108,10 @@ module Vagrant # Setup the home directory setup_home_path - @tmp_path = @home_path.join("tmp") @boxes_path = @home_path.join("boxes") + @data_dir = @home_path.join("data") @gems_path = @home_path.join("gems") + @tmp_path = @home_path.join("tmp") # Setup the local data directory. If a configuration path is given, # then it is expanded relative to the working directory. Otherwise, @@ -457,7 +465,7 @@ module Vagrant # Setup the list of child directories that need to be created if they # don't already exist. dirs = [@home_path] - subdirs = ["tmp", "boxes", "gems"] + subdirs = ["boxes", "data", "gems", "tmp"] dirs += subdirs.collect { |subdir| @home_path.join(subdir) } # Go through each required directory, creating it if it doesn't exist