Class: Audiothority::Crawler

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

Instance Method Summary collapse

Constructor Details

#initialize(dirs, blacklist = []) ⇒ Crawler

Returns a new instance of Crawler.



5
6
7
8
# File 'lib/audiothority/crawler.rb', line 5

def initialize(dirs, blacklist=[])
  @dirs = dirs
  @blacklist = blacklist
end

Instance Method Details

#crawlObject



10
11
12
13
14
15
16
17
18
# File 'lib/audiothority/crawler.rb', line 10

def crawl
  @dirs.each do |dir|
    dir.each_child do |path|
      if consider?(path)
        yield path
      end
    end
  end
end