Module: File::Where
- Defined in:
- lib/file/where.rb,
lib/file/where/where.rb,
lib/file/where/version.rb
Constant Summary collapse
- VERSION =
'0.0.0'
Class Method Summary collapse
Class Method Details
.are(cmd, env = ENV['PATH']) ⇒ Object
4 5 6 7 8 |
# File 'lib/file/where/where.rb', line 4 def self.are(cmd, env = ENV['PATH']) env.split(':').select do |dir| File.exist?(dir << '/' << cmd) end end |
.is(cmd, env = ENV['PATH']) ⇒ Object
10 11 12 |
# File 'lib/file/where/where.rb', line 10 def self.is(cmd, env = ENV['PATH']) are(cmd,env).shift end |