27 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
e7a6f397da Updates for Ruby 3.0 2021-06-21 15:57:46 -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
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
3b82f2efc4 Create the basic provider plugin interface.
Non-functional at this point.
2012-07-14 16:57:54 -07:00
Mitchell Hashimoto
70bdd9f56e Move host base class to a plugin component 2012-06-27 09:26:03 -07:00
Mitchell Hashimoto
53d8c28c8e Move guests to Vagrant.plugin("1", :guest) 2012-06-26 16:28:49 -07:00
Mitchell Hashimoto
b23dda54b8 Move command base class to a plugin component 2012-06-26 16:18:02 -07:00
Mitchell Hashimoto
7258daf535 Support specifying a component for Vagrant.plugin
The future of subclassing things like configuration bases and so on will
be to use `Vagrant.plugin(version, component)`. For example:
`Vagrant.plugin("1", :provisioner)`.
2012-06-26 15:47:26 -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
b7854c1ef6 Easy hooks 2012-05-05 22:31:21 -07:00
Mitchell Hashimoto
31ac7271aa Rename EasyCommand namespace to Easy 2012-05-05 22:16:13 -07:00
Mitchell Hashimoto
c2649074c3 Test command name validation and fix up some bugs 2012-05-05 20:11:26 -07:00
Mitchell Hashimoto
e4fa5bb489 Validate that commands only contain proper characters 2012-05-05 20:01:14 -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
cae80a7716 Make Vagrant::Plugin a module 2012-04-19 21:42:35 -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
0d7b9f84e2 Add logging to v1 plugin registration 2012-04-18 21:32:15 -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