Module: Tins::Find

Defined in:
lib/tins/find.rb

Defined Under Namespace

Classes: Finder

Constant Summary collapse

EXPECTED_STANDARD_ERRORS =
ModuleGroup[
  Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP,
  Errno::ENAMETOOLONG
]

Class Method Summary collapse

Class Method Details

.find(*paths, &block) ⇒ Object

Calls the associated block with the name of every path and directory listed as arguments, then recursively on their subdirectories, and so on.

See the Find module documentation for an example.



119
120
121
122
# File 'lib/tins/find.rb', line 119

def find(*paths, &block) # :yield: path
  opts = Hash === paths.last ? paths.pop : {}
  Finder.new(opts).find(*paths, &block)
end

.pruneObject

Skips the current path or directory, restarting the loop with the next entry. If the current path is a directory, that directory will not be recursively entered. Meaningful only within the block associated with Find::find.

See the Find module documentation for an example.



132
133
134
# File 'lib/tins/find.rb', line 132

def prune
  throw :prune
end