class Dir

Miscellaneous additional directory-related modules and classes.

Public Class Methods

walk(dirname, &block) click to toggle source

Adds a walk method to the standard Ruby Dir class. walk walks a directory tree, starting at dirname, invoking the supplied block on each directory. The block is passed a Dir object. The directory is walked top-down, not depth-first. To terminate the traversal, the block should return false. Anything else (including nil) continues the traversal.

Parameters:

dirname

The name (path) of the directory to walk.

block

The block to invoke on each entry.

# File lib/grizzled/dir.rb, line 51
def self.walk(dirname, &block)
  Grizzled::Directory.walk(dirname, &block)
end

Public Instance Methods

expand_path() click to toggle source

Adds an expand_path convenience method to the standard Ruby Dir class.

# File lib/grizzled/dir.rb, line 57
def expand_path
  File.expand_path(self.path)
end