Class: VagrantPlugins::DevCommands::Internal

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

Overview

Handles internal commands and their execution.

Constant Summary collapse

NAMESPACE =
VagrantPlugins::DevCommands::InternalCommand
COMMANDS =
{
  'help'    => CommandDef.new(NAMESPACE::Help::SPEC),
  'version' => CommandDef.new(NAMESPACE::Version::SPEC)
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(env, registry) ⇒ Internal

Returns a new instance of Internal.



12
13
14
15
16
17
18
# File 'lib/vagrant/devcommands/internal.rb', line 12

def initialize(env, registry)
  @internal = {
    'help'    => NAMESPACE::Help.new(env, registry),
    'version' => NAMESPACE::Version.new(env)
  }
  @registry = registry
end

Instance Method Details

#run(command, args) ⇒ Object



20
21
22
# File 'lib/vagrant/devcommands/internal.rb', line 20

def run(command, args)
  @internal[command].execute(args) if @internal.key?(command)
end