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.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/vagrant/plugin/v2/components.rb', line 72 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.
12 13 14 |
# File 'lib/vagrant/plugin/v2/components.rb', line 12 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.
19 20 21 |
# File 'lib/vagrant/plugin/v2/components.rb', line 19 def commands @commands end |
#configs ⇒ Hash<Symbol, Registry> (readonly)
This contains all the configuration plugins by scope.
24 25 26 |
# File 'lib/vagrant/plugin/v2/components.rb', line 24 def configs @configs end |
#guest_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered guest capabilities.
34 35 36 |
# File 'lib/vagrant/plugin/v2/components.rb', line 34 def guest_capabilities @guest_capabilities end |
#guests ⇒ Registry<Symbol, Array<Class, Symbol>> (readonly)
This contains all the guests and their parents.
29 30 31 |
# File 'lib/vagrant/plugin/v2/components.rb', line 29 def guests @guests end |
#host_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered host capabilities.
44 45 46 |
# File 'lib/vagrant/plugin/v2/components.rb', line 44 def host_capabilities @host_capabilities end |
#hosts ⇒ Registry<Symbol, Array<Class, Symbol>> (readonly)
This contains all the hosts and their parents.
39 40 41 |
# File 'lib/vagrant/plugin/v2/components.rb', line 39 def hosts @hosts end |
#provider_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered provider capabilities.
55 56 57 |
# File 'lib/vagrant/plugin/v2/components.rb', line 55 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.
50 51 52 |
# File 'lib/vagrant/plugin/v2/components.rb', line 50 def providers @providers end |
#pushes ⇒ Registry<Symbol, Array<Class, Hash>> (readonly)
This contains all the push implementations by name.
60 61 62 |
# File 'lib/vagrant/plugin/v2/components.rb', line 60 def pushes @pushes end |
#synced_folder_capabilities ⇒ Hash<Symbol, Registry> (readonly)
This contains all the registered synced folder capabilities.
70 71 72 |
# File 'lib/vagrant/plugin/v2/components.rb', line 70 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.
65 66 67 |
# File 'lib/vagrant/plugin/v2/components.rb', line 65 def synced_folders @synced_folders end |