Class: VagrantPlugins::DevCommands::Command

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

Overview

Defines the executable vagrant command

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv, env) ⇒ Command

Returns a new instance of Command.



9
10
11
12
13
# File 'lib/vagrant/devcommands/command.rb', line 9

def initialize(argv, env)
  @registry = Registry.new(env)

  super(argv, env)
end

Class Method Details

.synopsisObject



5
6
7
# File 'lib/vagrant/devcommands/command.rb', line 5

def self.synopsis
  'runs vagrant commands from a Commandfile'
end

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vagrant/devcommands/command.rb', line 15

def execute
  return 127 unless read_commandfile

  command = argv_command

  return 127 unless check_command(command)

  return run_internal(command) if @registry.reserved_command?(command)

  run @registry.commands[command]
end