Class: RbFind::Walk
- Inherits:
-
Object
- Object
- RbFind::Walk
- Defined in:
- lib/rbfind.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#wd ⇒ Object
readonly
Returns the value of attribute wd.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
297 298 299 |
# File 'lib/rbfind.rb', line 297 def count @count end |
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
297 298 299 |
# File 'lib/rbfind.rb', line 297 def depth @depth end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
297 298 299 |
# File 'lib/rbfind.rb', line 297 def start @start end |
#wd ⇒ Object (readonly)
Returns the value of attribute wd.
297 298 299 |
# File 'lib/rbfind.rb', line 297 def wd @wd end |
Class Method Details
.run(*args, **params, &block) ⇒ Object
262 263 264 265 266 |
# File 'lib/rbfind.rb', line 262 def run *args, **params, &block i = new **params, &block i.run *args i.count end |
Instance Method Details
#run(*args) ⇒ Object
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
# File 'lib/rbfind.rb', line 299 def run *args @levels, @depth = [], 0 args.flatten! args.compact! if args.empty? then visit_dir Dir::CUR_DIR else args.each { |base| handle_error do File.exists? base or raise "`#{base}` doesn't exist." visit_depth base end } end ensure @levels = @depth = nil end |