Class: TestServer::VirusDetector

Inherits:
Object
  • Object
show all
Includes:
FeduxOrgStdlib::Command::Which, RunCommand
Defined in:
lib/test_server/virus_detector.rb

Instance Method Summary collapse

Methods included from RunCommand

#run_command

Constructor Details

#initialize(command: which('clamdscan')) ⇒ VirusDetector

Returns a new instance of VirusDetector



11
12
13
14
# File 'lib/test_server/virus_detector.rb', line 11

def initialize(command: which('clamdscan'))
  @command = command
  @timeout = 60
end

Instance Method Details

#use(file) ⇒ Object



16
17
18
# File 'lib/test_server/virus_detector.rb', line 16

def use(file)
  file.virus_id = scan(file)
end