Class: ClamChowder::Backend::Stub

Inherits:
Object
  • Object
show all
Defined in:
lib/clam_chowder/backend/stub.rb

Instance Method Summary collapse

Instance Method Details

#scan_file(path) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/clam_chowder/backend/stub.rb', line 7

def scan_file(path)
  if File.open(path, encoding: 'BINARY') {|f| f.each_line.grep(/virus/).empty? }
    ClamChowder::Response.new('OK', path)
  else
    ClamChowder::Response.new('FOUND', path, 'stub-virus')
  end
end