module Rake

def each_dir_parent(dir) # :nodoc:

:nodoc:
Yield each file or directory component.
def each_dir_parent(dir)    # :nodoc:
  old_length = nil
  while dir != "." && dir.length != old_length
    yield(dir)
    old_length = dir.length
    dir = File.dirname(dir)
  end
end