File: scan_and_queue.rb

package info (click to toggle)
ruby-directory-watcher 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 224 kB
  • ctags: 224
  • sloc: ruby: 1,411; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# ScanAndQueue creates a Scan from its input globs and then sends that Scan to
# its Queue.
#
# Every time scan_and_queue is called a new scan is created an sent to the
# queue.
class DirectoryWatcher::ScanAndQueue

  def initialize( glob, queue )
    @globs = glob
    @queue =queue
  end

  # Create and run a Scan and submit it to the Queue.
  #
  # Returns the Scan that was run
  def scan_and_queue
    scan = ::DirectoryWatcher::Scan.new( @globs )
    scan.run
    @queue.enq scan
    return scan
  end
end