Sha256: 9df6a9aba3b582632c238cf2178ff5aca9a4c06829320b6ed7414b11e087fabe

Contents?: true

Size: 366 Bytes

Versions: 1

Compression:

Stored size: 366 Bytes

Contents

require 'English'

module HSS
  ##
  # Runs a shell command and returns the output
  class Parser
    private

    def command(input)
      result = IO.popen(input) { |cmd| cmd.read.chomp }
      raise("Command failed: #{input}") unless $CHILD_STATUS.exitstatus.zero?
      result
    rescue Errno::ENOENT
      raise "Command not found: #{input}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hss-1.1.0 lib/hss/helpers/command.rb