130 Commits

Author SHA1 Message Date
Mitchell Hashimoto
1ee470a551 Begin work on supporting provider-specific configuration
This works by registering a `config` with `:provider => true` with the
same name as your provider. Vagrant will then automatically configure
the provider when `config.vm.provider` is used.
2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
99c5cddb7d V2 config supports the concept of an "UNSET" value when doing merges
This value should be used as a default, and allows the parent `merge`
method to "just work" most of the time.
2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
59d5c5ed92 Add support for "upgrade safe" config classes to plugins.
These are classes that use NO core classes of Vagrant, and are therefore
safe to load for upgrades. i.e. a V2 core can load a V1 config class
that is deemed upgrade safe without crashing Vagrant.
2012-11-03 21:39:06 -07:00
Mitchell Hashimoto
68923ff556 Additional tests for the plugin manager. 2012-11-03 21:30:22 -07: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
5ae3e0e80c Allow the definition of communicators in plugins 2012-08-08 21:52:25 -07:00
Mitchell Hashimoto
a1cef830e3 Add the Communicator plugin API.
This allows communication protocols to be defined for the machine. This
is how things like SSH will be implemented.
2012-08-08 21:28:28 -07:00
Mitchell Hashimoto
1a2a8b49c0 Provider API to return SSH info, must implement ssh_info.
Since SSH is such a critical part of Vagrant, each provider must
implement a method that returns the proper way to SSH into the machine.
2012-08-05 12:41:05 -07:00
Mitchell Hashimoto
912998ef31 Fill in the provider API a bit more to what it is. 2012-07-16 15:24:51 -07:00
Mitchell Hashimoto
3519bf0372 Add the "provider" API to the V1 plugin. 2012-07-15 11:17:58 -07:00
Mitchell Hashimoto
436da57cc4 Add the #action API to the provider plugin 2012-07-14 17:04:06 -07:00
Mitchell Hashimoto
70bdd9f56e Move host base class to a plugin component 2012-06-27 09:26:03 -07:00
Mitchell Hashimoto
b23dda54b8 Move command base class to a plugin component 2012-06-26 16:18:02 -07:00
Mitchell Hashimoto
41bc8e7454 Move Config::V1::Base to Vagrant::Plugin::V1::Config 2012-06-24 17:06:11 -07:00
Mitchell Hashimoto
ffab8cab68 Renamespace V1 plugin root to Vagrant::Plugin::V1::Plugin
This is mostly a transparent change to end users, but I'm going to put
all base classes for V1 into Vagrant::Plugin::V1.
2012-06-24 14:24:52 -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
0d6248394c Tests for the Easy command base 2012-05-06 10:01:50 -07:00
Ryan LeCompte
2355a4b9a6 fix support for multiple unique easy commands 2012-05-06 01:47:43 -07:00
Mitchell Hashimoto
4cc3fb05df Passing unit tests 2012-05-05 22:32:19 -07:00
Mitchell Hashimoto
c2649074c3 Test command name validation and fix up some bugs 2012-05-05 20:11:26 -07:00
Mitchell Hashimoto
00aba5ac03 Plugin easy commands.
Easy commands are well... easy! They don't offer the full power of
creating a completely custom command class, but they let you do the
basics (what almost everyone needs) with minimal fuss. Example:

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

  easy_command "foo" do |action|
    puts "HELLO!"
  end
end

NOTE: The "action" stuff isn't done yet, but will be soon!
2012-05-05 18:57:29 -07:00
Mitchell Hashimoto
8850c086b1 Plugins can now have action_hooks 2012-05-05 18:28:07 -07:00
Mitchell Hashimoto
1489854d70 Move commands into plugins 2012-04-19 13:59:48 -07:00
Mitchell Hashimoto
661f20bb91 Move hosts to a plugin system 2012-04-18 22:20:45 -07:00
Mitchell Hashimoto
1cbac3167f Move provisioners into plugins 2012-04-18 21:53:19 -07:00
Mitchell Hashimoto
7766eb6098 Major guests have been moved to plugins 2012-04-18 21:03:03 -07:00
Mitchell Hashimoto
92ee042fc2 V1 config loading using plugins as a source for config keys 2012-04-16 22:26:38 -07:00
Mitchell Hashimoto
b46daa82bc Ability to define configuration classes on plugins 2012-04-15 16:04:54 -05:00
Mitchell Hashimoto
2eebc2cb68 Basic Plugin class 2012-04-15 15:34:44 -05:00