Sha256: 579bd15238ffc34b845f280263ca1fddb8429240eb25de565eb95e1369baf84d

Contents?: true

Size: 373 Bytes

Versions: 3

Compression:

Stored size: 373 Bytes

Contents

class BuildEm::ConditionMatcher
  def match(return_code, output, condition)
    case condition
    when Regexp
      return false unless output =~ condition
    when String
      return false unless output == condition
    when Fixnum
      return false unless return_code == condition
    else
      raise "unsupported type for condition"
    end
    return true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
buildem-1.0.0 lib/buildem/condition_matcher.rb
buildem-0.0.5 lib/buildem/condition_matcher.rb
buildem-0.0.4 lib/buildem/condition_matcher.rb