lib/utilrb/pathname/find_matching_parent.rb
# Returns the path object that is the first parent of self matching the
# given predicate
#
# @yieldparam [Pathname] path the path object that should be tested
# @yieldreturn [Boolean] true if this is the path you are looking for, and
#   false otherwise
# @return [Pathname,nil] the matching path or nil if none could be found
Returns the path object that is the first parent of self matching the
given predicate
Returns the path object that is the first parent of self matching the given predicate
def find_matching_parent
        curdir = self
        while !curdir.root? && !yield(curdir)
            curdir = curdir.parent
        end
        if !curdir.root?
            curdir
        end
    end
def find_matching_parent curdir = self while ! curdir . root? && ! yield ( curdir ) curdir = curdir . parent end if ! curdir . root? curdir end end
Returns the path object that is the first parent of self matching the
given predicate
Returns the path object that is the first parent of self matching the given predicate
# Look for a bundle in the parents of Dir.pwd
true if this is the path you are looking for, and false otherwise
true if this is the path you are looking for and false otherwise
Boolean
the matching path or nil if none could be found
the matching path or nil if none could be found
Pathname,nil
<not_specific>
path the path object that should be tested
path the path object that should be tested