Class: SecurityReport::UnpatchedGemResult
- Inherits:
-
Object
- Object
- SecurityReport::UnpatchedGemResult
- Extended by:
- Forwardable
- Defined in:
- lib/security_report/unpatched_gem_result.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(scan_result, target) ⇒ UnpatchedGemResult
constructor
A new instance of UnpatchedGemResult.
- #problem ⇒ Object
- #solution ⇒ Object
Constructor Details
#initialize(scan_result, target) ⇒ UnpatchedGemResult
Returns a new instance of UnpatchedGemResult.
13 14 15 16 17 |
# File 'lib/security_report/unpatched_gem_result.rb', line 13 def initialize(scan_result, target) @identifier = scan_result.gem.to_s @advisory = scan_result.advisory @target = target end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
8 9 10 |
# File 'lib/security_report/unpatched_gem_result.rb', line 8 def identifier @identifier end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
9 10 11 |
# File 'lib/security_report/unpatched_gem_result.rb', line 9 def target @target end |
Class Method Details
.matches?(obj) ⇒ Boolean
31 32 33 |
# File 'lib/security_report/unpatched_gem_result.rb', line 31 def self.matches?(obj) obj.instance_of? ::Bundler::Audit::Scanner::UnpatchedGem end |
Instance Method Details
#problem ⇒ Object
19 20 21 |
# File 'lib/security_report/unpatched_gem_result.rb', line 19 def problem Problem.new(problem_id, advisory.title, advisory.url) end |
#solution ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/security_report/unpatched_gem_result.rb', line 23 def solution if advisory.patched_versions.empty? "Remove or disable this gem until a patch is available!" else "Upgrade to a new version" end end |