diff --git a/config/default.rb b/config/default.rb index b3a296be9..87cd728d1 100644 --- a/config/default.rb +++ b/config/default.rb @@ -1,6 +1,7 @@ Vagrant::Config.run do |config| # default config goes here config.vagrant.log_output = STDOUT + config.vagrant.dotfile_name = ".vagrant" config.vagrant.home = "~/.vagrant" config.ssh.username = "vagrant" @@ -9,8 +10,6 @@ Vagrant::Config.run do |config| config.ssh.forwarded_port_key = "ssh" config.ssh.max_tries = 10 - config.dotfile_name = ".vagrant" - config.vm.box_ovf = "box.ovf" config.vm.base_mac = "0800279C2E42" config.vm.project_directory = "/vagrant" diff --git a/lib/vagrant/config.rb b/lib/vagrant/config.rb index 97a8592f0..fee8047dc 100644 --- a/lib/vagrant/config.rb +++ b/lib/vagrant/config.rb @@ -118,6 +118,7 @@ module Vagrant end class VagrantConfig < Base + attr_accessor :dotfile_name attr_accessor :log_output attr_accessor :home @@ -127,7 +128,6 @@ module Vagrant end class Top < Base - attr_accessor :dotfile_name attr_reader :package attr_reader :ssh attr_reader :vm diff --git a/lib/vagrant/env.rb b/lib/vagrant/env.rb index f214fcd0d..b666410b3 100644 --- a/lib/vagrant/env.rb +++ b/lib/vagrant/env.rb @@ -14,7 +14,7 @@ module Vagrant def box; @@box; end def persisted_vm; @@persisted_vm; end def root_path; @@root_path; end - def dotfile_path; File.join(root_path, Vagrant.config.dotfile_name); end + def dotfile_path; File.join(root_path, Vagrant.config.vagrant.dotfile_name); end def home_path; File.expand_path(Vagrant.config.vagrant.home); end def tmp_path; File.join(home_path, "tmp"); end def boxes_path; File.join(home_path, "boxes"); end diff --git a/test/test_helper.rb b/test/test_helper.rb index 0286474f7..214c95247 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -24,7 +24,7 @@ class Test::Unit::TestCase Vagrant::Config.instance_variable_set(:@config, nil) Vagrant::Config.run do |config| - config.dotfile_name = ".hobo" + config.vagrant.dotfile_name = ".hobo" config.ssh.username = "foo" config.ssh.password = "bar" diff --git a/test/vagrant/env_test.rb b/test/vagrant/env_test.rb index 37ac4c33e..ce11be832 100644 --- a/test/vagrant/env_test.rb +++ b/test/vagrant/env_test.rb @@ -151,7 +151,7 @@ class EnvTest < Test::Unit::TestCase end test "should build up the dotfile out of the root path and the dotfile name" do - assert_equal File.join(Vagrant::Env.root_path, Vagrant.config.dotfile_name), Vagrant::Env.dotfile_path + assert_equal File.join(Vagrant::Env.root_path, Vagrant.config.vagrant.dotfile_name), Vagrant::Env.dotfile_path end end