Sha256: 74de7a719abc8a6f06d131697c755c991fbcf1b356e7db9779df00ed50097cd4

Contents?: true

Size: 594 Bytes

Versions: 20

Compression:

Stored size: 594 Bytes

Contents

module Ddr::Actions
  class VirusCheck

    # @return [Hash] result data
    # @raises [Ddr::Antivirus::VirusFoundError]
    def self.call(file_path)
      Hash.new.tap do |result|
        begin
          scan_result = Ddr::Antivirus.scan(file_path)
        rescue Ddr::Antivirus::ScannerError => e
          result[:exception] = [e.class.name, e.to_s]
          scan_result = e.result
        end
        result[:event_date_time] = scan_result.scanned_at
        result[:software]        = scan_result.version
        result[:detail]          = scan_result.output
      end
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ddr-models-2.11.0 lib/ddr/actions/virus_check.rb
ddr-models-2.10.2 lib/ddr/actions/virus_check.rb
ddr-models-2.10.1 lib/ddr/actions/virus_check.rb
ddr-models-2.10.0 lib/ddr/actions/virus_check.rb
ddr-models-2.10.0.rc2 lib/ddr/actions/virus_check.rb
ddr-models-2.10.0.rc1 lib/ddr/actions/virus_check.rb
ddr-models-2.9.2 lib/ddr/actions/virus_check.rb
ddr-models-2.9.1 lib/ddr/actions/virus_check.rb
ddr-models-2.9.0 lib/ddr/actions/virus_check.rb
ddr-models-2.9.0.rc1 lib/ddr/actions/virus_check.rb
ddr-models-2.8.0 lib/ddr/actions/virus_check.rb
ddr-models-2.8.0.rc1 lib/ddr/actions/virus_check.rb
ddr-models-2.7.6 lib/ddr/actions/virus_check.rb
ddr-models-2.7.5 lib/ddr/actions/virus_check.rb
ddr-models-2.7.4 lib/ddr/actions/virus_check.rb
ddr-models-2.7.3 lib/ddr/actions/virus_check.rb
ddr-models-2.7.2 lib/ddr/actions/virus_check.rb
ddr-models-2.7.1 lib/ddr/actions/virus_check.rb
ddr-models-2.7.0 lib/ddr/actions/virus_check.rb
ddr-models-2.7.0.rc1 lib/ddr/actions/virus_check.rb