Sha256: eb497c3f99652c04ae48a845ac2ef9f141fb817d232d1e2761b888dacc7c8851

Contents?: true

Size: 361 Bytes

Versions: 11

Compression:

Stored size: 361 Bytes

Contents

module Rake::Funnel::Support
  class Which
    class << self
      def which(executable)
        return executable if File.file?(executable)

        ENV['PATH']
          .split(File::PATH_SEPARATOR)
          .map { |path| File.join(path, executable) }
          .select { |path| File.file?(path) }
          .first
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rake-funnel-0.3.2.pre lib/rake/funnel/support/which.rb
rake-funnel-0.3.1.pre lib/rake/funnel/support/which.rb
rake-funnel-0.3.0.pre lib/rake/funnel/support/which.rb
rake-funnel-0.2.0.pre lib/rake/funnel/support/which.rb
rake-funnel-0.1.0.pre lib/rake/funnel/support/which.rb
rake-funnel-0.0.6.pre lib/rake/funnel/support/which.rb
rake-funnel-0.0.5.pre lib/rake/funnel/support/which.rb
rake-funnel-0.0.4.pre lib/rake/funnel/support/which.rb
rake-funnel-0.0.3.pre lib/rake/funnel/support/which.rb
rake-funnel-0.0.2.pre lib/rake/funnel/support/which.rb
rake-funnel-0.0.1.pre lib/rake/funnel/support/which.rb