Class: Bundler::Audit::Presenter::Base
- Inherits:
-
Object
- Object
- Bundler::Audit::Presenter::Base
- Defined in:
- lib/bundler/audit/presenter/base.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
Instance Method Summary collapse
- #exit_code ⇒ Object
-
#initialize(shell, options) ⇒ Base
constructor
A new instance of Base.
- #print_report ⇒ Object
- #problematic? ⇒ Boolean protected
- #push_advisory(advisory) ⇒ Object
- #push_warning(message) ⇒ Object
Constructor Details
#initialize(shell, options) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 |
# File 'lib/bundler/audit/presenter/base.rb', line 8 def initialize(shell, ) @shell = shell @options = @warnings = [] @advisory_bundles = [] end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/bundler/audit/presenter/base.rb', line 5 def @options end |
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
6 7 8 |
# File 'lib/bundler/audit/presenter/base.rb', line 6 def shell @shell end |
Instance Method Details
#exit_code ⇒ Object
27 28 29 |
# File 'lib/bundler/audit/presenter/base.rb', line 27 def exit_code problematic? ? 1 : 0 end |
#print_report ⇒ Object
23 24 25 |
# File 'lib/bundler/audit/presenter/base.rb', line 23 def print_report raise RuntimeError, "Not Implemented" end |
#problematic? ⇒ Boolean (protected)
33 34 35 |
# File 'lib/bundler/audit/presenter/base.rb', line 33 def problematic? @warnings.any? || @advisory_bundles.any? end |
#push_advisory(advisory) ⇒ Object
19 20 21 |
# File 'lib/bundler/audit/presenter/base.rb', line 19 def push_advisory(advisory) @advisory_bundles.push(advisory) end |
#push_warning(message) ⇒ Object
15 16 17 |
# File 'lib/bundler/audit/presenter/base.rb', line 15 def push_warning() @warnings.push() end |