Class: VagrantPlugins::DevCommands::Registry
- Inherits:
-
Object
- Object
- VagrantPlugins::DevCommands::Registry
- Defined in:
- lib/vagrant/devcommands/registry.rb
Overview
Vagrant command registry
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
Instance Method Summary collapse
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #read_commandfile(commandfile) ⇒ Object
- #valid_command?(command) ⇒ Boolean
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
7 8 9 |
# File 'lib/vagrant/devcommands/registry.rb', line 7 def initialize @commands = {} end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
5 6 7 |
# File 'lib/vagrant/devcommands/registry.rb', line 5 def commands @commands end |
Instance Method Details
#read_commandfile(commandfile) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/vagrant/devcommands/registry.rb', line 11 def read_commandfile(commandfile) contents = commandfile.path.read instance_eval(contents) append_legacy end |
#valid_command?(command) ⇒ Boolean
18 19 20 |
# File 'lib/vagrant/devcommands/registry.rb', line 18 def valid_command?(command) @commands.include? command end |