class File

Public Class Methods

each_parent(dir, file) { |join.sub(/^\.\//, "")| ... } click to toggle source

Walk each parent directory of dir looking for file. Yield each file found to caller.

# File lib/zenweb/extensions.rb, line 5
def File.each_parent dir, file
  until dir == "." do
    dir = File.dirname dir
    yield File.join(dir, file).sub(/^\.\//, "")
  end
end