Use the .vagrantrc for plugins!

This commit is contained in:
Mitchell Hashimoto 2012-05-05 13:08:07 -07:00
parent d9034da8a4
commit 462136cbf2
2 changed files with 12 additions and 3 deletions

View File

@ -6,8 +6,8 @@
so that plugins will always _load_ (though they will almost certainly
not be _functional_ in future versions of Vagrant).
- Plugins no longer "autoload" by simply gem installing them. This increases
Vagrant's initial startup time considerably. To replace this, you can use
the `vagrant plugin` interface.
Vagrant's initial startup time considerably. To replace this, you must now
explicitly require plugins in the `~/.vagrantrc` file.
- Improve the SSH "ready?" check. [GH-841]
- Human friendly error if connection times out for HTTP downloads. [GH-849]
- Detect when the VirtualBox installation is incomplete and error. [GH-846]

View File

@ -15,6 +15,7 @@ module Vagrant
HOME_SUBDIRS = ["tmp", "boxes", "gems"]
DEFAULT_VM = :default
DEFAULT_HOME = "~/.vagrant.d"
DEFAULT_RC = "~/.vagrantrc"
# The `cwd` that this environment represents
attr_reader :cwd
@ -519,7 +520,15 @@ module Vagrant
::Gem.clear_paths
# Load the plugins
# XXX: TODO
rc_path = File.expand_path(ENV["VAGRANT_RC"] || DEFAULT_RC)
if File.file?(rc_path)
# We use a `require` here instead of a load so the same file will
# only be loaded once.
@logger.debug("Loading RC file: #{rc_path}")
require rc_path
else
@logger.debug("RC file not found. Not loading: #{rc_path}")
end
end
end
end