14 Commits

Author SHA1 Message Date
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