Class: Package::Audit::Ruby::VulnerabilityFinder
- Inherits:
-
Object
- Object
- Package::Audit::Ruby::VulnerabilityFinder
- Defined in:
- lib/package/audit/ruby/vulnerability_finder.rb
Instance Method Summary collapse
-
#initialize(dir) ⇒ VulnerabilityFinder
constructor
A new instance of VulnerabilityFinder.
- #run ⇒ Object
Constructor Details
#initialize(dir) ⇒ VulnerabilityFinder
Returns a new instance of VulnerabilityFinder.
8 9 10 11 |
# File 'lib/package/audit/ruby/vulnerability_finder.rb', line 8 def initialize(dir) @dir = dir @vuln_hash = {} end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/package/audit/ruby/vulnerability_finder.rb', line 13 def run json_result = `#{format(Const::Cmd::BUNDLE_AUDIT_JSON, @dir)}` vulnerability_json_array = JSON.parse(json_result, symbolize_names: true)[:results] vulnerability_json_array.each do |vulnerability_json| (vulnerability_json) end @vuln_hash.values end |