Merge pull request #936 from sgmap/rename_variable

Rename variable path_file => file_path
This commit is contained in:
Mathieu Magnin 2017-11-16 12:36:06 +01:00 committed by GitHub
commit 95b6ec2899
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,13 +1,13 @@
class ClamavService class ClamavService
def self.safe_file? path_file def self.safe_file? file_path
if Rails.env == 'development' if Rails.env == 'development'
return CLAMAV[:response] if CLAMAV[:mock?] return CLAMAV[:response] if CLAMAV[:mock?]
end end
FileUtils.chmod 0666, path_file FileUtils.chmod 0666, file_path
client = ClamAV::Client.new client = ClamAV::Client.new
response = client.execute(ClamAV::Commands::ScanCommand.new(path_file)) response = client.execute(ClamAV::Commands::ScanCommand.new(file_path))
return false if response.first.class == ClamAV::VirusResponse return false if response.first.class == ClamAV::VirusResponse
true true