Bug #3514 » pathname.patch
| lib/pathname.rb | ||
|---|---|---|
|
def relative?
|
||
|
path = @path
|
||
|
while r = chop_basename(path)
|
||
|
path, basename = r
|
||
|
path, = r
|
||
|
end
|
||
|
path == ''
|
||
|
end
|
||
| ... | ... | |
|
#
|
||
|
def each_filename # :yield: filename
|
||
|
return to_enum(__method__) unless block_given?
|
||
|
prefix, names = split_names(@path)
|
||
|
_, names = split_names(@path)
|
||
|
names.each {|filename| yield filename }
|
||
|
nil
|
||
|
end
|
||
| ... | ... | |
|
path = @path
|
||
|
yield self
|
||
|
while r = chop_basename(path)
|
||
|
path, name = r
|
||
|
path, = r
|
||
|
break if path.empty?
|
||
|
yield self.class.new(del_trailing_separator(path))
|
||
|
end
|
||