Class: GemWatch::Check

Inherits:
Object
  • Object
show all
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

Update

Defined Under Namespace

Classes: Update

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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

#impactsObject (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.

Returns:

  • (Boolean)


26
27
28
# File 'lib/gem_watch/check.rb', line 26

def passed?
  @impacts.empty?
end

#resultsObject

Pretty displays of results (interpretation of impacts).



31
32
33
# File 'lib/gem_watch/check.rb', line 31

def results
  @impacts.inspect
end

#runObject

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