Class: Vagrant::Plugin::V2::Components
- Inherits:
-
Object
- Object
- Vagrant::Plugin::V2::Components
- Defined in:
- lib/vagrant/plugin/v2/components.rb
Overview
This is the container class for the components of a single plugin. 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.
Instance Attribute Summary collapse
-
#action_hooks ⇒ Hash<Symbol, Array>
readonly
This contains all the action hooks.
-
#commands ⇒ Registry<Symbol, Array<Proc, Hash>>
readonly
This contains all the command plugins by name, and returns the command class and options.
-
#configs ⇒ Hash<Symbol, Registry>
readonly
This contains all the configuration plugins by scope.
-
#guest_capabilities ⇒ Hash<Symbol, Registry>
readonly
This contains all the registered guest capabilities.
-
#guests ⇒ Registry<Symbol, Array<Class, Symbol>>
readonly
This contains all the guests and their parents.
-
#host_capabilities ⇒ Hash<Symbol, Registry>
readonly
This contains all the registered host capabilities.
-
#hosts ⇒ Registry<Symbol, Array<Class, Symbol>>
readonly
This contains all the hosts and their parents.
-
#provider_capabilities ⇒ Hash<Symbol, Registry>
readonly
This contains all the registered provider capabilities.
-
#providers ⇒ Hash<Symbol, Registry>
readonly
This contains all the provider plugins by name, and returns the provider class and options.
-
#pushes ⇒ Registry<Symbol, Array<Class, Hash>>
readonly
This contains all the push implementations by name.
-
#synced_folder_capabilities ⇒ Hash<Symbol, Registry>
readonly
This contains all the registered synced folder capabilities.
-
#synced_folders ⇒ Registry<Symbol, Array<Class, Integer>>
readonly
This contains all the synced folder implementations by name.
Instance Method Summary collapse
-
#initialize ⇒ Components
constructor
A new instance of Components.
Constructor Details
#initialize ⇒ Components
Returns a new instance of Components.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/vagrant/plugin/v2/components.rb', line 75 def initialize # The action hooks hash defaults to [] @action_hooks = Hash.new { |h, k| h[k] = [] } @commands = Registry.new @configs = Hash.new { |h, k| h[k] = Registry.new } @guests = Registry.new @guest_capabilities = Hash.new { |h, k| h[k] = Registry.new } @hosts = Registry.new @host_capabilities = Hash.new { |h, k| h[k] = Registry.new } @providers = Registry.new @provider_capabilities = Hash.new { |h, k| h[k] = Registry.new } @pushes = Registry.new @synced_folders = Registry.new @synced_folder_capabilities = Hash.new { |h, k| h[k] = Registry.new } end |
Instance Attribute Details
#action_hooks ⇒ Hash<Symbol, Array> (readonly)
This contains all the action hooks.
15 16 17 |
# File 'lib/vagrant/plugin/v2/components.rb', line 15 def action_hooks @action_hooks end |
#commands ⇒ Registry<Symbol, Array<Proc, Hash>> (readonly)
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.
22 23 24 |
# File 'lib/vagrant/plugin/v2/components.rb', line 22 def commands @commands end |
#configs ⇒ Hash<Symbol, Registry> (readonly)
This contains all the configuration plugins by scope.
27 28 29 |
# File 'lib/vagrant/plugin/v2/components.rb', line 27 def configs @configs end |
#guest_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered guest capabilities.
37 38 39 |
# File 'lib/vagrant/plugin/v2/components.rb', line 37 def guest_capabilities @guest_capabilities end |
#guests ⇒ Registry<Symbol, Array<Class, Symbol>> (readonly)
This contains all the guests and their parents.
32 33 34 |
# File 'lib/vagrant/plugin/v2/components.rb', line 32 def guests @guests end |
#host_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered host capabilities.
47 48 49 |
# File 'lib/vagrant/plugin/v2/components.rb', line 47 def host_capabilities @host_capabilities end |
#hosts ⇒ Registry<Symbol, Array<Class, Symbol>> (readonly)
This contains all the hosts and their parents.
42 43 44 |
# File 'lib/vagrant/plugin/v2/components.rb', line 42 def hosts @hosts end |
#provider_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered provider capabilities.
58 59 60 |
# File 'lib/vagrant/plugin/v2/components.rb', line 58 def provider_capabilities @provider_capabilities end |
#providers ⇒ Hash<Symbol, Registry> (readonly)
This contains all the provider plugins by name, and returns the provider class and options.
53 54 55 |
# File 'lib/vagrant/plugin/v2/components.rb', line 53 def providers @providers end |
#pushes ⇒ Registry<Symbol, Array<Class, Hash>> (readonly)
This contains all the push implementations by name.
63 64 65 |
# File 'lib/vagrant/plugin/v2/components.rb', line 63 def pushes @pushes end |
#synced_folder_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered synced folder capabilities.
73 74 75 |
# File 'lib/vagrant/plugin/v2/components.rb', line 73 def synced_folder_capabilities @synced_folder_capabilities end |
#synced_folders ⇒ Registry<Symbol, Array<Class, Integer>> (readonly)
This contains all the synced folder implementations by name.
68 69 70 |
# File 'lib/vagrant/plugin/v2/components.rb', line 68 def synced_folders @synced_folders end |