Method: Utils::Finder#initialize
- Defined in:
- lib/utils/finder.rb
#initialize(opts = {}) ⇒ Finder
Returns a new instance of Finder.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/utils/finder.rb', line 13 def initialize(opts = {}) @args = opts[:args] || {} @roots = opts[:roots] || [] @config = opts[:config] || Utils::Config::ConfigFile.new pattern_opts = opts.subhash(:pattern) | { :cset => @args['a'], :icase => @args['i'], } @binary = @args['b'] @pattern = @args['r'] ? RegexpPattern.new(pattern_opts) : FuzzyPattern.new(pattern_opts) @directory = @args['d'] @only_directory = @args['D'] @paths = [] end |