lib/fde/file_crawler.rb in fde-file_crawler-0.5.1 vs lib/fde/file_crawler.rb in fde-file_crawler-0.6.0

- old
+ new

@@ -16,15 +16,12 @@ def self.configure yield self.config end - # TODO: remove conditional - def self.watch(query = nil, &block) - unless query.nil? - yield self.crawl(query) - else - yield self.crawl + def self.watch(query = /.*\.*/i, &block) + self.crawl(query).each do |file| + yield file end end def self.crawl(query = /.*\.*/i) path = self.config.path_in_directory