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)


49
50
51
52
53
54
55
56
# File 'lib/cem/ccommon.rb', line 49

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