Class: GemWatch::Check
- Inherits:
-
Object
- Object
- GemWatch::Check
- Defined in:
- lib/gem_watch/check.rb
Overview
Implements a check which will run some tests on one or multiple gems. Negative results that need to be noticed are stored in the impacts hash. This class implements basic behavior for check, specific test implementation and interpretation is done in the children classes.
Direct Known Subclasses
Defined Under Namespace
Classes: Update
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Stores the gem name to check on.
-
#impacts ⇒ Object
readonly
Hash to store which gem has failed check and why.
Instance Method Summary collapse
-
#initialize(gem_name = :all) ⇒ Check
constructor
Take a
gem_nameto check. -
#passed? ⇒ Boolean
Returns true if test was passed, false otherwise.
-
#results ⇒ Object
Pretty displays of results (interpretation of
impacts). -
#run ⇒ Object
Run check on
gem_name.
Constructor Details
#initialize(gem_name = :all) ⇒ Check
Take a gem_name to check.
15 16 17 18 |
# File 'lib/gem_watch/check.rb', line 15 def initialize(gem_name = :all) @gem_name = gem_name @impacts = {} end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Stores the gem name to check on
9 10 11 |
# File 'lib/gem_watch/check.rb', line 9 def gem_name @gem_name end |
#impacts ⇒ Object (readonly)
Hash to store which gem has failed check and why
12 13 14 |
# File 'lib/gem_watch/check.rb', line 12 def impacts @impacts end |
Instance Method Details
#passed? ⇒ Boolean
Returns true if test was passed, false otherwise.
26 27 28 |
# File 'lib/gem_watch/check.rb', line 26 def passed? @impacts.empty? end |
#results ⇒ Object
Pretty displays of results (interpretation of impacts).
31 32 33 |
# File 'lib/gem_watch/check.rb', line 31 def results @impacts.inspect end |
#run ⇒ Object
Run check on gem_name.
21 22 23 |
# File 'lib/gem_watch/check.rb', line 21 def run raise "Not implemented for this check." end |