Class: RbFind::Walk

Inherits:
Object
  • Object
show all
Defined in:
lib/rbfind.rb

Defined Under Namespace

Classes: Params

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



311
312
313
# File 'lib/rbfind.rb', line 311

def count
  @count
end

#currentObject (readonly)

Returns the value of attribute current.



313
314
315
# File 'lib/rbfind.rb', line 313

def current
  @current
end

#depthObject (readonly)

Returns the value of attribute depth.



312
313
314
# File 'lib/rbfind.rb', line 312

def depth
  @depth
end

#startObject (readonly)

Returns the value of attribute start.



311
312
313
# File 'lib/rbfind.rb', line 311

def start
  @start
end

Class Method Details

.run(*args, **params, &block) ⇒ Object



264
265
266
267
268
# File 'lib/rbfind.rb', line 264

def run *args, **params, &block
  i = new **params, &block
  i.run *args
  i.count
end

Instance Method Details

#run(*args) ⇒ Object



296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/rbfind.rb', line 296

def run *args
  args.flatten!
  args.compact!
  if args.empty? then
    visit_dir Dir::CUR_DIR
  else
    list = args.map { |base| Entry.new base, self }
    list.select! { |e| handle_error do e.stat end }
    sort_entries list
    step_depth_args do
      list.each { |e| enter e }
    end
  end
end