Class: Rack::SecureUpload::Scanner::Avast

Inherits:
Base
  • Object
show all
Defined in:
lib/rack/secure_upload/scanner/avast.rb

Instance Attribute Summary

Attributes inherited from Base

#logger, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Rack::SecureUpload::Scanner::Base

Instance Method Details

#scan(path) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rack/secure_upload/scanner/avast.rb', line 11

def scan(path)
  now_umask = ::File.umask(0)

  lock do
    output = command.run(path: path)
    logger.info output
  end

  ::File.exist?(path)
ensure
  ::File.umask(now_umask)
end

#setupObject

Raises:



7
8
9
# File 'lib/rack/secure_upload/scanner/avast.rb', line 7

def setup
  raise SetupError, "#{options[:bin_path]} is not found." unless ::File.exists?(options[:bin_path])
end