Class: Aruba::Platforms::WindowsCommandString

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/aruba/platforms/windows_command_string.rb

Overview

This is a command which should be run

This adds cmd.exec in front of commmand

Instance Method Summary collapse

Constructor Details

#initialize(cmd) ⇒ WindowsCommandString

Returns a new instance of WindowsCommandString.



13
14
15
# File 'lib/aruba/platforms/windows_command_string.rb', line 13

def initialize(cmd)
  __setobj__ format('%s /c "%s"', Aruba.platform.which('cmd.exe'), cmd)
end

Instance Method Details

#to_aObject

Convert to array



18
19
20
# File 'lib/aruba/platforms/windows_command_string.rb', line 18

def to_a
  Shellwords.split __getobj__
end

#to_sObject Also known as: inspect



23
24
25
# File 'lib/aruba/platforms/windows_command_string.rb', line 23

def to_s
  __getobj__.to_s
end