Sha256: 921da85392da96dc81d93fb45dcf550eeb62a3ad52158d2f90dca55b5542a601

Contents?: true

Size: 551 Bytes

Versions: 25

Compression:

Stored size: 551 Bytes

Contents


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

25 entries across 25 versions & 1 rubygems

Version Path
toolrack-0.24.3 lib/toolrack/cli_utils.rb
toolrack-0.24.2 lib/toolrack/cli_utils.rb
toolrack-0.24.1 lib/toolrack/cli_utils.rb
toolrack-0.24.0 lib/toolrack/cli_utils.rb
toolrack-0.23.3 lib/toolrack/cli_utils.rb
toolrack-0.23.2 lib/toolrack/cli_utils.rb
toolrack-0.22.1 lib/toolrack/cli_utils.rb
toolrack-0.22.0 lib/toolrack/cli_utils.rb
toolrack-0.21.0 lib/toolrack/cli_utils.rb
toolrack-0.20.2 lib/toolrack/cli_utils.rb
toolrack-0.20.1 lib/toolrack/cli_utils.rb
toolrack-0.20.0 lib/toolrack/cli_utils.rb
toolrack-0.19.1 lib/toolrack/cli_utils.rb
toolrack-0.18.6 lib/toolrack/cli_utils.rb
toolrack-0.18.5 lib/toolrack/cli_utils.rb
toolrack-0.18.4 lib/toolrack/cli_utils.rb
toolrack-0.18.3 lib/toolrack/cli_utils.rb
toolrack-0.18.2 lib/toolrack/cli_utils.rb
toolrack-0.18.1 lib/toolrack/cli_utils.rb
toolrack-0.18.0 lib/toolrack/cli_utils.rb