409 Commits

Author SHA1 Message Date
Mitchell Hashimoto
ac7958a43b Environment#primary_machine takes a provider argument. Use it. 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
128c06e78d Environment#default_provider 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
2da812bd48 Change log levels of some messages that are useful 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
c9d5cff7be Add in some logging 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
819140bbc2 Don't error if box doesn't exist on load 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
f2b91d26fd Load the configuration per machine, so that provider boxes work
Boxes are provider-specific, and we don't know the provider until
Environment#machine is called, so we need to build up the machine
configuration during this time.
2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
1559f7b7a7 Get rid of the old Environment#vms calls. Use #machine everywhere. 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
b416665fd7 Just some comments 2012-11-07 22:21:48 -08:00
Mitchell Hashimoto
2ef6ff10f0 Cache the machine objects created in Environment#machine.
Each machine and provider backing should be represented by only one
machine.
2012-11-07 22:08:06 -08:00
Mitchell Hashimoto
67855be77b Add the Environment#machine method
This will eventually replace the Environment#vms method. Because of the
introduction of providers, the environment doesn't know what the backing
of the machines will be (and they're _machines_ now, not _vms_).
Instead, users of Environment will now call `#machine` on the
environment to retrieve a machine with the given backing provider as it
needs it.
2012-11-07 21:45:09 -08:00
Mitchell Hashimoto
81ca275792 Providers to V2 2012-11-06 21:20:55 -08:00
Mitchell Hashimoto
5a33b7ee54 Hosts to V2 2012-11-06 21:20:22 -08:00
Mitchell Hashimoto
c803b0508a Much cleaner plugin part querying syntax.
Before we were manually going over every plugin and getting each piece,
all over the place. Now we have a central manager that will give us all
the pieces we want. There is still some cleanup to do here but this is
much better overall.
2012-11-03 21:25:28 -07:00
Mitchell Hashimoto
6df6f6764f Remove plugin activation. It really isn't necessary.
It was only used in a couple places and it isn't necessary since you can
do the loading within the actual blocks themselves.
2012-11-03 20:29:34 -07:00
Mitchell Hashimoto
2e25285297 Add nice inspect results for Environment and Machine 2012-08-10 00:38:11 -07:00
Mitchell Hashimoto
2ef20586da Remove the action registry feature.
This can be removed since in the future all actions will come from the
providers or something. There are still issues with box actions but
we'll get back to that later...
2012-07-26 21:57:11 -07:00
Mitchell Hashimoto
44b4b9dfef Move drivers to the VirtualBox plugin. Use Machine class.
This starts the transition of replacing VM with Machine. Machine still
isn't ready to fully replace VM but by moving it now, I'm able to find
the spots that need to be fixed. At this point `vagrant status` works
with the new provider interface.
2012-07-24 21:32:38 -07:00
Mark LaPerriere
28e19d5449 Update load_plugins to be more Windows friendly. Uses File::PATH_SEPARATOR instead of hard-coded colon (':'). 2012-07-12 15:25:28 -03:00
Mitchell Hashimoto
623ecb3e3d Environment attempts to upgrade box on config load.
If a V1 box is encountered when Vagrant loads the configuration, then it
will be upgraded on the fly.
2012-07-11 18:36:22 -07:00
Mitchell Hashimoto
da15105a8f Make Box2 the new Box
This involved defaulting all box searching at the moment to VirtualBox.
Additionally, box upgrading is not yet handled. This needs to be done at
some point.
2012-07-11 18:36:21 -07:00
Mitchell Hashimoto
70bdd9f56e Move host base class to a plugin component 2012-06-27 09:26:03 -07:00
Mitchell Hashimoto
9bc1ea5f04 Use config finalize to move some version-specific logic to the version
This moves out the concept of a "default VM" from the Environment class
and makes it the responsibility of the V1 configuration that at least
one VM is defined on it. This lets the configuration ultimately decide
what a "default" implementation is.
2012-06-23 12:48:53 -07:00
Mitchell Hashimoto
7e19d6849b Config loader no longer assumes latest version for procs.
Previously, all procs were assumed to just be the current version. This
is certainly not going to be true always so now the version number of
the configuration must be explicit if you're assigning a proc to the
configuration loader.
2012-06-23 12:06:54 -07:00
Mitchell Hashimoto
b3db82e516 Separate out the versions the config loader knows as init params.
This means that the Config::Loader now only knows how to load
configuration for versions used to initialize the class. This lets
things like the tests be completely isolated from what the actual
configuration is for Vagrant. This will be immensely useful to verify
that the loader functionality works for non-trivial bits (like
upgrading) without depending on Vagrant's upgrading functionality.
2012-06-23 11:33:53 -07:00
Mitchell Hashimoto
51be92eeb6 Remove dependence on V1 Kernel from Environment 2012-06-14 18:46:48 -07:00
Matt Robenolt
db76b42ef5 Allow the .vagrant dotfile to be moved into a completely different directory tree
I wanted to define my dotfile as: `config.vagrant.dotfile_name =
"~/.vagrant-projectname"` and noticed that the full path wasn't
expanded as expected.

This patch allows the vagrant file to be placed anywhere on the
filesystem.
2012-06-09 22:56:54 -07:00
Mitchell Hashimoto
de78a3637a Plugin activation
Vagrant is only guaranteeing that the plugin definition superclass (the
Vagrant.plugin("1") part) is backwards compatible. Anything else, such
as Vagrant::Command::Base and so on, will likely change in future
versions. Beacuse of this, plugins should only immediately expose their
definition.

In order to support loading the other classes, plugins should defer
loading to the "activation" phase of a plugin. This can be done using
the `activated` block:

    class MyPlugin < Vagrant.plugin("1")
      name "my plugin"

      activated do
        require "myplugin/my_command"
      end

      command("foo") { MyCommand }
    end

Plugin activation is done at two specific times:

  * Right when a Vagrant::Environment is created and the global plugins
    (such as from ~.vagrantrc) are loaded.
  * Right before loading configuration, but after the Vagrantfiles have
    been evaluated. This allows plugins to be defined within these files
    as well.
2012-05-21 22:23:50 -07:00
Mitchell Hashimoto
d230f0a41c Environment.rb doesn't need to load in "rubygems" anymore 2012-05-06 13:49:22 -07:00
Mitchell Hashimoto
de92f5217c Use load for the Vagrantrc, make sure it is only loaded once 2012-05-06 10:09:33 -07:00
Mitchell Hashimoto
462136cbf2 Use the .vagrantrc for plugins! 2012-05-05 13:08:07 -07:00
Mitchell Hashimoto
d9034da8a4 Remove gem-based plugin loading 2012-05-05 12:57:31 -07:00
Mitchell Hashimoto
cae80a7716 Make Vagrant::Plugin a module 2012-04-19 21:42:35 -07:00
Mitchell Hashimoto
661f20bb91 Move hosts to a plugin system 2012-04-18 22:20:45 -07:00
Mitchell Hashimoto
a23fee4848 Remove old configuration classes 2012-04-18 17:16:03 -07:00
Mitchell Hashimoto
f8fa859b5f Raise an error if the CWD is incorrect 2012-03-08 16:57:17 -08:00
Mitchell Hashimoto
6969f791ad VAGRANT_CWD can be set to set the CWD of vagrant. 2012-03-08 16:45:19 -08:00
Mitchell Hashimoto
ce00a56ecb Even with a custom vagrantfile name, use defaults [GH-778] 2012-03-08 13:24:04 -08:00
Mitchell Hashimoto
700938b668 Load rubygems in environment.rb [GH-781] 2012-03-07 22:15:45 -08:00
Mitchell Hashimoto
2c823e98bd Fix crashing bug with primary_vm on Environment 2012-02-24 10:27:34 -08:00
Mitchell Hashimoto
13fddfa6f9 Load plugins with the private gem path.
This changed plugin loading semantics a tiny bit, since they are
no longer loaded when Vagrant is loaded but instead when the
Vagrant::Environment is initialized. I'll note this in the CHANGELOG.
2012-02-06 22:39:35 -05:00
Mitchell Hashimoto
d19f7a44e5 Starting on the vagrant gem command. 2012-02-06 22:16:37 -05:00
Mitchell Hashimoto
88ba3a3619 Change middleware internals to make plugin lives easier [GH-684] 2012-01-28 17:31:50 -08:00
Mitchell Hashimoto
6d212efdbd Fix ppk path by just... not using ppk anymore. [GH-634] 2012-01-12 18:03:35 -08:00
Mitchell Hashimoto
ef37f692bd Revert the check for duplicate Vagrantfiles.
This is just tricky with case sensitive/insensitive file systems.
Reverting since it doesn't seem worth it.
2012-01-08 23:15:18 -08:00
Mitchell Hashimoto
4f30a834d0 Tests for multivagrantfile being found 2012-01-08 23:04:23 -08:00
Mitchell Hashimoto
8c00d1d652 Raise an error if multiple matching Vagrantfiles are found [GH-588] 2012-01-08 11:54:32 -08:00
Mitchell Hashimoto
75539c2abe Default host class is the base class 2012-01-07 13:13:17 -08:00
Mitchell Hashimoto
0887a18079 Make some fixes to get tests passing on Ruby 1.8.7 2011-12-26 17:45:55 -08:00
Mitchell Hashimoto
2de7a1424d Load VirtualBox VM in the VM class 2011-12-20 21:20:45 -08:00
Mitchell Hashimoto
9debf5abe9 Attach a driver to each VM. Use that to detect VirtualBox. 2011-12-20 21:20:45 -08:00