Class: VagrantPlugins::DevCommands::Command

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

Overview

Defines the executable vagrant command

Constant Summary collapse

I18N_KEY =
'vagrant_devcommands.'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv, env) ⇒ Command

Returns a new instance of Command.



15
16
17
18
19
# File 'lib/vagrant/devcommands/command.rb', line 15

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

  super(argv, env)
end

Class Method Details

.synopsisObject



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

def self.synopsis
  synopsis = VagrantPlugins::DevCommands::SYNOPSIS

  synopsis[0, 1].downcase + synopsis[1..-1]
end

Instance Method Details

#executeObject



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/vagrant/devcommands/command.rb', line 21

def execute
  return 127 unless read_commandfile

  command = Util.argv_command(@argv, @env)

  return 127 unless non_empty?(command)
  return 127 unless available?(command)

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

  run command
end

#proxy_with_target_vms(names = nil, options = nil, &block) ⇒ Object



34
35
36
37
# File 'lib/vagrant/devcommands/command.rb', line 34

def proxy_with_target_vms(names = nil, options = nil, &block)
  # allows public access to protected method with_target_vms
  with_target_vms(names, options, &block)
end