Class: Unwrappr::Writers::SecurityVulnerabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/unwrappr/writers/security_vulnerabilities.rb

Overview

Present reported security vulnerabilities in the gem change annotation.

Implements the ‘annotation_writer` interface required by the LockFileAnnotator.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gem_change, gem_change_info) ⇒ SecurityVulnerabilities

Returns a new instance of SecurityVulnerabilities.



14
15
16
17
# File 'lib/unwrappr/writers/security_vulnerabilities.rb', line 14

def initialize(gem_change, gem_change_info)
  @gem_change = gem_change
  @gem_change_info = gem_change_info
end

Class Method Details

.write(gem_change, gem_change_info) ⇒ Object



10
11
12
# File 'lib/unwrappr/writers/security_vulnerabilities.rb', line 10

def self.write(gem_change, gem_change_info)
  new(gem_change, gem_change_info).write
end

Instance Method Details

#writeObject



19
20
21
22
23
24
25
26
27
# File 'lib/unwrappr/writers/security_vulnerabilities.rb', line 19

def write
  return nil if vulnerabilities.nil?

  "    \#{patched_vulnerabilities}\n    \#{introduced_vulnerabilities}\n    \#{remaining_vulnerabilities}\n  MESSAGE\nend\n"