Sha256: 84c576ef11718da3aeed9d49c50b628271fa329bfc4a7f81237fa5e7127e4717

Contents?: true

Size: 472 Bytes

Versions: 9

Compression:

Stored size: 472 Bytes

Contents

require 'delegate'

module Aruba
  module Platforms
    # This is a command which should be run
    class WindowsCommandString < SimpleDelegator
      def initialize(cmd)
        __setobj__ format('%s /c "%s"', Aruba.platform.which('cmd.exe'), cmd)
      end

      def to_a
        Shellwords.split __getobj__
      end

      if RUBY_VERSION < '1.9'
        def to_s
          __getobj__.to_s
        end
        alias_method :inspect, :to_s
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
aruba-0.11.0.pre lib/aruba/platforms/windows_command_string.rb
aruba-0.10.2 lib/aruba/platforms/windows_command_string.rb
aruba-0.10.1 lib/aruba/platforms/windows_command_string.rb
aruba-0.10.0 lib/aruba/platforms/windows_command_string.rb
aruba-0.10.0.pre2 lib/aruba/platforms/windows_command_string.rb
aruba-0.10.0.pre lib/aruba/platforms/windows_command_string.rb
aruba-0.9.0 lib/aruba/platforms/windows_command_string.rb
aruba-0.9.0.pre2 lib/aruba/platforms/windows_command_string.rb
aruba-0.9.0.pre lib/aruba/platforms/windows_command_string.rb