class Gemika::Matrix::Row

A row in the test matrix

Attributes

gemfile[R]

The path to the gemfile for the row.

ruby[R]

The Ruby version for the row.

Public Class Methods

new(attrs) click to toggle source
# File lib/gemika/matrix.rb, line 15
def initialize(attrs)
  @ruby = attrs.fetch(:ruby)
  @gemfile = attrs.fetch(:gemfile)
end

Public Instance Methods

compatible_with_ruby?(current_ruby = Env.ruby) click to toggle source

Returns whether this row can be run with the given Ruby version.

# File lib/gemika/matrix.rb, line 33
def compatible_with_ruby?(current_ruby = Env.ruby)
  ruby == current_ruby
end
validate!() click to toggle source

Raises an error if this row is invalid.

@!visibility private

# File lib/gemika/matrix.rb, line 42
def validate!
  File.exists?(gemfile) or raise MissingGemfile, "Gemfile not found: #{gemfile}"
  contents = File.read(gemfile)
  contents.include?('gemika') or raise UnusableGemfile, "Gemfile is missing gemika dependency: #{gemfile}"
end