Module: FileCrawler::Finder::Command::Collect

Includes:
Base
Included in:
FileCrawler::Finder
Defined in:
lib/file_crawler/finder/command/collect.rb

Defined Under Namespace

Classes: Organizer

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

#exec

Instance Attribute Details

#regexsObject

Returns the value of attribute regexs.



28
29
30
# File 'lib/file_crawler/finder/command/collect.rb', line 28

def regexs
  @regexs
end

Instance Method Details

#collect(options = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/file_crawler/finder/command/collect.rb', line 34

def collect(options={})
  tap {
    if options[:regexs].is_a?(Array)
      options[:regexs].each {|o|
        regexs << FileCrawler::Regex.new(o[0], o[1]) if o.size == 2
      }
    end

    @collections = Organizer.new.run(@files, regexs)
  }
end