Class: ESearchy::LocalEngines::Directory
- Inherits:
-
Object
- Object
- ESearchy::LocalEngines::Directory
- Defined in:
- lib/esearchy/LocalEngines/directory.rb
Instance Method Summary collapse
-
#initialize(dir) ⇒ Directory
constructor
A new instance of Directory.
- #search ⇒ Object
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
#search ⇒ Object
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 |