Method: Codependency::Path#find

Defined in:
lib/codependency/path.rb

#find(str) ⇒ Object

Attempts to find the given file in this path set. Raises Errno::ENOENT if the file cannot be found.



43
44
45
46
47
48
49
50
51
# File 'lib/codependency/path.rb', line 43

def find( str )
  super lambda { raise Errno::ENOENT, str } do |dir|
    path = extensions.find do |ext|
      file = dir.join str + ext
      break file if file.exist?
    end
    break path if path
  end
end