Sha256: 9ad4a741b3f281fb1645744c4f2390ded82f3defd3b9d7a3caa307b906e8e87b

Contents?: true

Size: 524 Bytes

Versions: 1

Compression:

Stored size: 524 Bytes

Contents

require 'eicar/version'

module EICAR

  def self.version
    EICAR::VERSION
  end

  class Error < StandardError
  end

  class EICARReadError < Error
  end

  def self.test_string
    lib_path = File.expand_path(File.dirname(__FILE__))
    bin_path = File.expand_path(File.join(lib_path, "..", "bin"))
    com_file = File.join(bin_path, "eicar.com")
    begin
    data = File.open(com_file, "rb") {|f| f.read f.stat.size}
    rescue SystemCallError
      raise EICAR::EICARReadError
    end
  end

end

EICAR.test_string

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
EICAR-0.0.1 lib/eicar.rb