Class: VagrantPlugins::DevCommands::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/devcommands/registry.rb

Overview

Vagrant command registry

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



7
8
9
# File 'lib/vagrant/devcommands/registry.rb', line 7

def initialize
  @commands = {}
end

Instance Attribute Details

#commandsObject

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

Returns:

  • (Boolean)


18
19
20
# File 'lib/vagrant/devcommands/registry.rb', line 18

def valid_command?(command)
  @commands.include? command
end