Sha256: 5254cd2216262529a9a3e15e109a50d59bf3455c980709136c54858e8bc0e82e

Contents?: true

Size: 906 Bytes

Versions: 3

Compression:

Stored size: 906 Bytes

Contents

require "gem_watch"

# Implements a check which will run some tests on one or multiple gems.
# Negative results that need to be noticed are stored in the <tt>impacts</tt> hash.
# This class implements basic behavior for check, specific test implementation
# and interpretation is done in the children classes.
class GemWatch::Check
  # Stores the gem name to check on
  attr_reader :gem_name
  
  # Hash to store which gem has failed check and why
  attr_reader :impacts
  
  # Take a <tt>gem_name</tt> to check.
  def initialize(gem_name = :all)
    @gem_name = gem_name
    @impacts = {}
  end
  
  # Run check on <tt>gem_name</tt>.
  def run
    raise "Not implemented for this check."
  end
  
  # Returns true if test was passed, false otherwise.
  def passed?
    @impacts.empty?
  end

  # Pretty displays of results (interpretation of <tt>impacts</tt>).
  def results
    @impacts.inspect
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gem_watch-0.1.2 lib/gem_watch/check.rb
gem_watch-0.1.0 lib/gem_watch/check.rb
gem_watch-0.1.1 lib/gem_watch/check.rb