Sha256: 7f52eeb53d8adbb9935f090b2ebc1236de2161ef1c9b4e904617164d49c5ddc3

Contents?: true

Size: 472 Bytes

Versions: 5

Compression:

Stored size: 472 Bytes

Contents

require 'delegate'
require 'shellwords'

# Aruba
module Aruba
  # Platforms
  module Platforms
    # This is a command which should be run
    class UnixCommandString < SimpleDelegator
      def initialize(cmd)
        __setobj__ cmd
      end

      # Convert to array
      def to_a
        Shellwords.split __getobj__
      end

      if RUBY_VERSION < '1.9'
        def to_s
          __getobj__.to_s
        end
        alias inspect to_s
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
aruba-0.14.3 lib/aruba/platforms/unix_command_string.rb
aruba-win-fix-0.14.2 lib/aruba/platforms/unix_command_string.rb
aruba-0.14.2 lib/aruba/platforms/unix_command_string.rb
aruba-0.14.1 lib/aruba/platforms/unix_command_string.rb
aruba-0.14.0 lib/aruba/platforms/unix_command_string.rb