Sha256: a652a8e88d608baa7b6c1eb2afabb0cf125ea8c0bd59b467774de3ffa5da3406
Contents?: true
Size: 767 Bytes
Versions: 2
Compression:
Stored size: 767 Bytes
Contents
# Aruba module Aruba # Platforms module Platforms # This is a command which should be run # # This adds `cmd.exec` in front of commmand # # @private class WindowsCommandString def initialize(command, *arguments) @command = command @arguments = arguments end # Convert to array def to_a [cmd_path, '/c', [escaped_command, *escaped_arguments].join(' ')] end private def escaped_arguments @arguments.map { |arg| arg.gsub(/"/, '"""') }. map { |arg| arg =~ / / ? "\"#{arg}\"" : arg } end def escaped_command @command.gsub(/ /, '""" """') end def cmd_path Aruba.platform.which('cmd.exe') end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aruba-1.0.0.pre.alpha.4 | lib/aruba/platforms/windows_command_string.rb |
aruba-1.0.0.pre.alpha.3 | lib/aruba/platforms/windows_command_string.rb |