Method: Utils::Finder#initialize

Defined in:
lib/utils/finder.rb

#initialize(opts = {}) ⇒ Finder

Returns a new instance of Finder.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/utils/finder.rb', line 17

def initialize(opts = {})
  @args  = opts[:args] || {}
  @roots = discover_roots(opts[:roots])
  @config = opts[:config] || Utils::ConfigFile.new
  pattern_opts = opts.subhash(:pattern) | {
    :cset  => @args[?a],
    :icase => @args[?i] != ?n,
  }
  @pattern = choose(@args[?p], pattern_opts)
  @paths  = []
  reset_index
end