Module: Rclam::ClamAV

Defined in:
lib/rclam/clamav.rb

Class Method Summary collapse

Class Method Details

.installed?Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/rclam/clamav.rb', line 4

def self.installed?
  executable_location = %x{which clamscan}
  !executable_location.empty?
end

.scan(location) ⇒ Object



18
19
20
21
# File 'lib/rclam/clamav.rb', line 18

def self.scan(location)
  output, err, status = Open3.capture3("clamscan -ri #{location}")
  output
end

.up_to_date?Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/rclam/clamav.rb', line 9

def self.up_to_date?
  last_update = Rclam::Helpers.last_signatures_update
  Rclam::Helpers.date_within_a_day?(last_update)
end

.updateObject



14
15
16
# File 'lib/rclam/clamav.rb', line 14

def self.update
  %x{freshclam}
end