Class: Aruba::Platforms::WindowsCommandString
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Aruba::Platforms::WindowsCommandString
- 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
-
#initialize(cmd) ⇒ WindowsCommandString
constructor
A new instance of WindowsCommandString.
-
#to_a ⇒ Object
Convert to array.
- #to_s ⇒ Object (also: #inspect)
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_a ⇒ Object
Convert to array
18 19 20 21 |
# File 'lib/aruba/platforms/windows_command_string.rb', line 18 def to_a Shellwords.split( __getobj__.gsub('\\', 'ARUBA_TMP_PATHSEPARATOR') ). map { |w| w.gsub('ARUBA_TMP_PATHSEPARATOR', '\\') } end |
#to_s ⇒ Object Also known as: inspect
24 25 26 |
# File 'lib/aruba/platforms/windows_command_string.rb', line 24 def to_s __getobj__.to_s end |