Class: Vagrant::Ruby::Command

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Command

Returns a new instance of Command.



30
31
32
# File 'lib/vagrant/ruby.rb', line 30

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



28
29
30
# File 'lib/vagrant/ruby.rb', line 28

def name
  @name
end

Instance Method Details

#executeObject



42
43
44
45
# File 'lib/vagrant/ruby.rb', line 42

def execute
  command = File.join(Gem.default_bindir, name)
  Process.exec([command, name], *ARGV[1..-1])
end

#new(*_) ⇒ Object

Oy vey.



34
35
36
# File 'lib/vagrant/ruby.rb', line 34

def new(*_) # Oy vey.
  self
end

#synopsisObject



38
39
40
# File 'lib/vagrant/ruby.rb', line 38

def synopsis
  "execute Vagrant's embedded #{name}"
end