Class: ESearchy::LocalEngines::Directory

Inherits:
Object
  • Object
show all
Defined in:
lib/esearchy/LocalEngines/directory.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Directory

Returns a new instance of Directory.



4
5
6
7
# File 'lib/esearchy/LocalEngines/directory.rb', line 4

def initialize(dir)
  @documents = Queue.new
  @emails = []
end

Instance Method Details

#searchObject



9
10
11
12
# File 'lib/esearchy/LocalEngines/directory.rb', line 9

def search
  files = Dir["#{@dir}/**/*.*"]
  files.select {|x| /.pdf$|.doc$|.docx$|.xlsx$|.pptx$|.odt$|.odp$|.ods$|.odb$|.txt$|.rtf$|.ans$|.csv$|.xml|.json$|.html$/i}.each { |f| @documents.push(f) }
end