Sha256: 7d325c5b8cefb2967481f89a233a9a40fe8bc9cb5af603d69f62d51ef8f5c8d3

Contents?: true

Size: 426 Bytes

Versions: 23

Compression:

Stored size: 426 Bytes

Contents

module Simp; end
module Simp::CommandUtils
  require 'facter'

  def which(cmd, fail=false)
    @which_cache ||= {}

    if @which_cache.has_key?(cmd)
      command = @which_cache[cmd]
    else
      command = Facter::Core::Execution.which(cmd)
      @which_cache[cmd] = command
    end

    msg = "Warning: Command #{cmd} not found on the system."

    ( fail ? raise(msg) : warn(msg) ) unless command

    command
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
simp-rake-helpers-5.22.1 lib/simp/command_utils.rb
simp-rake-helpers-5.22.0 lib/simp/command_utils.rb
simp-rake-helpers-5.21.0 lib/simp/command_utils.rb
simp-rake-helpers-5.20.0 lib/simp/command_utils.rb
simp-rake-helpers-5.19.2 lib/simp/command_utils.rb
simp-rake-helpers-5.19.0 lib/simp/command_utils.rb
simp-rake-helpers-5.18.0 lib/simp/command_utils.rb
simp-rake-helpers-5.17.1 lib/simp/command_utils.rb
simp-rake-helpers-5.17.0 lib/simp/command_utils.rb
simp-rake-helpers-5.16.0 lib/simp/command_utils.rb
simp-rake-helpers-5.15.0 lib/simp/command_utils.rb
simp-rake-helpers-5.14.0 lib/simp/command_utils.rb
simp-rake-helpers-5.13.2 lib/simp/command_utils.rb
simp-rake-helpers-5.13.1 lib/simp/command_utils.rb
simp-rake-helpers-5.13.0 lib/simp/command_utils.rb
simp-rake-helpers-5.12.7 lib/simp/command_utils.rb
simp-rake-helpers-5.12.6 lib/simp/command_utils.rb
simp-rake-helpers-5.12.5 lib/simp/command_utils.rb
simp-rake-helpers-5.12.4 lib/simp/command_utils.rb
simp-rake-helpers-5.12.3 lib/simp/command_utils.rb