2012-11-19 06:55:30 +00:00
|
|
|
module Vagrant
|
|
|
|
module Plugin
|
|
|
|
module V2
|
|
|
|
# This is the container class for the components of a single plugin.
|
2013-01-13 20:38:17 +00:00
|
|
|
# This allows us to separate the plugin class which defines the
|
|
|
|
# components, and the actual container of those components. This
|
|
|
|
# removes a bit of state overhead from the plugin class itself.
|
2012-11-19 06:55:30 +00:00
|
|
|
class Components
|
2013-02-06 23:27:14 +00:00
|
|
|
# This contains all the action hooks.
|
|
|
|
#
|
2013-02-22 20:12:55 +00:00
|
|
|
# @return [Hash<Symbol, Array>]
|
2013-02-06 23:27:14 +00:00
|
|
|
attr_reader :action_hooks
|
|
|
|
|
2014-01-11 16:38:27 +00:00
|
|
|
# This contains all the command plugins by name, and returns
|
|
|
|
# the command class and options. The command class is wrapped
|
|
|
|
# in a Proc so that it can be lazy loaded.
|
|
|
|
#
|
|
|
|
# @return [Registry<Symbol, Array<Proc, Hash>>]
|
|
|
|
attr_reader :commands
|
|
|
|
|
2013-01-13 20:38:17 +00:00
|
|
|
# This contains all the configuration plugins by scope.
|
|
|
|
#
|
|
|
|
# @return [Hash<Symbol, Registry>]
|
|
|
|
attr_reader :configs
|
2012-11-19 06:55:30 +00:00
|
|
|
|
2013-04-04 04:47:57 +00:00
|
|
|
# This contains all the guests and their parents.
|
|
|
|
#
|
|
|
|
# @return [Registry<Symbol, Array<Class, Symbol>>]
|
|
|
|
attr_reader :guests
|
|
|
|
|
2013-04-04 05:40:30 +00:00
|
|
|
# This contains all the registered guest capabilities.
|
|
|
|
#
|
|
|
|
# @return [Hash<Symbol, Registry>]
|
|
|
|
attr_reader :guest_capabilities
|
|
|
|
|
2014-01-08 02:38:49 +00:00
|
|
|
# This contains all the hosts and their parents.
|
|
|
|
#
|
|
|
|
# @return [Registry<Symbol, Array<Class, Symbol>>]
|
|
|
|
attr_reader :hosts
|
|
|
|
|
|
|
|
# This contains all the registered host capabilities.
|
|
|
|
#
|
|
|
|
# @return [Hash<Symbol, Registry>]
|
|
|
|
attr_reader :host_capabilities
|
|
|
|
|
2013-03-22 00:57:31 +00:00
|
|
|
# This contains all the provider plugins by name, and returns
|
|
|
|
# the provider class and options.
|
|
|
|
#
|
|
|
|
# @return [Hash<Symbol, Registry>]
|
|
|
|
attr_reader :providers
|
|
|
|
|
2014-01-26 21:55:11 +00:00
|
|
|
# This contains all the registered provider capabilities.
|
|
|
|
#
|
|
|
|
# @return [Hash<Symbol, Registry>]
|
|
|
|
attr_reader :provider_capabilities
|
|
|
|
|
2013-11-21 23:56:37 +00:00
|
|
|
# This contains all the synced folder implementations by name.
|
|
|
|
#
|
2013-11-23 00:12:51 +00:00
|
|
|
# @return [Registry<Symbol, Array<Class, Integer>>]
|
2013-11-21 23:56:37 +00:00
|
|
|
attr_reader :synced_folders
|
|
|
|
|
2012-11-19 06:55:30 +00:00
|
|
|
def initialize
|
2013-02-22 20:12:55 +00:00
|
|
|
# The action hooks hash defaults to []
|
|
|
|
@action_hooks = Hash.new { |h, k| h[k] = [] }
|
2013-02-06 23:27:14 +00:00
|
|
|
|
2014-01-11 16:38:27 +00:00
|
|
|
@commands = Registry.new
|
2013-01-13 20:38:17 +00:00
|
|
|
@configs = Hash.new { |h, k| h[k] = Registry.new }
|
2013-04-04 04:47:57 +00:00
|
|
|
@guests = Registry.new
|
2013-04-04 05:40:30 +00:00
|
|
|
@guest_capabilities = Hash.new { |h, k| h[k] = Registry.new }
|
2014-01-08 02:38:49 +00:00
|
|
|
@hosts = Registry.new
|
|
|
|
@host_capabilities = Hash.new { |h, k| h[k] = Registry.new }
|
2013-03-22 00:57:31 +00:00
|
|
|
@providers = Registry.new
|
2014-01-26 21:55:11 +00:00
|
|
|
@provider_capabilities = Hash.new { |h, k| h[k] = Registry.new }
|
2013-11-21 23:56:37 +00:00
|
|
|
@synced_folders = Registry.new
|
2012-11-19 06:55:30 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|