Sha256: c9de60f788f2b484b83de9960cb348171ee5c48c49d02128881d0f1f104b92bf

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

require 'pty'
require 'expect'

module Antrapol
  module ToolRack
    module CliUtils
      include Antrapol::ToolRack::ConditionUtils 

      class CliUtilsError < StandardError; end

      def which(app)
        if not_empty?(app)
          path = `which #{app}` 
          path.strip if not_empty?(path)
        else
          raise CliUtilsError, "Given appication to look for full path (which) is empty"
        end
      end


      def self.included(klass)
        klass.class_eval <<-END
        extend Antrapol::ToolRack::CliUtils
        END
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
toolrack-0.14.0 lib/toolrack/cli_utils.rb