Sha256: 491d47d59b090b2925389b222dadad6aa18e4e418e8a894ff07ac85ae8105b36

Contents?: true

Size: 400 Bytes

Versions: 2

Compression:

Stored size: 400 Bytes

Contents

require 'clam_chowder/backend/clamd'
require 'clam_chowder/response'

module ClamChowder
  module Backend
    class Stub
      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
clam_chowder-0.0.2 lib/clam_chowder/backend/stub.rb
clam_chowder-0.0.1 lib/clam_chowder/backend/stub.rb