Module: Utils::Find

Included in:
Finder, Grepper, IRB::Shell
Defined in:
lib/utils/find.rb

Defined Under Namespace

Classes: ConfigurableFinder

Class Method Summary collapse

Class Method Details

.find(*paths, &block) ⇒ Object

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

See the Find module documentation for an example.



138
139
140
141
# File 'lib/utils/find.rb', line 138

def find(*paths, &block) # :yield: path
  paths, options = paths.extract_last_argument_options
  ConfigurableFinder.new(options).find(*paths, &block)
end

.pruneObject

Skips the current file or directory, restarting the loop with the next entry. If the current file 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.



151
152
153
# File 'lib/utils/find.rb', line 151

def prune
  throw :prune
end