kobaltz / clamby

ClamAV interface to your Ruby on Rails project.
MIT License
132 stars 29 forks source link

[FEATURE] Extract virus details and include in VirusDetected #41

Open abrom opened 2 years ago

abrom commented 2 years ago

Great gem @kobaltz thanks!

I've got a requirement to display the type of virus that has been detected. I've already written the changes needed to add this to clamby but thought I'd check if that would be something you'd be interested in merging before creating the PR.

Basically just modifying the Command class, specifically the .scan and #run methods to parse the console output and include the parsed virus type when raising the VirusDetected error. My change swaps out the system call with a Open3 library function call to peek at the output and error streams.

Thoughts?

abrom commented 2 years ago

i.e.

https://github.com/kobaltz/clamby/compare/master...abrom:add-virus-type-parser

arianf commented 2 years ago

I've been waiting for this feature foreverrrr