Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/cem/ccommon.rb

Class Method Summary collapse

Class Method Details

.exist_first?(*candidates) ⇒ Boolean

Returns the first match of the given files

Returns:

  • (Boolean)


17
18
19
20
21
22
23
24
# File 'lib/cem/ccommon.rb', line 17

def self.exist_first?(*candidates)
  candidates.each { |candidate|
    if File.exist?(candidate)
      return candidate
    end
  }
  return nil
end