Method: Pathname#descend

Defined in:
lib/nano/pathname/descend.rb

#descendObject

Calls the block for every successive subdirectory of the directory path from the root (absolute path) unitl . (relative path) is reached.



11
12
13
14
15
16
# File 'lib/nano/pathname/descend.rb', line 11

def descend()
  @path.scan(%r{[^/]*/?})[0...-1].inject('') do |path, dir|
    yield Pathname.new(path << dir)
  path
  end
end