Sha256: 421ab9fe95d707e43bfede6ea3f2f56da4d932ef423b9ad5d1f52d8ab698233b
Contents?: true
Size: 710 Bytes
Versions: 8
Compression:
Stored size: 710 Bytes
Contents
module Fitting class Host class Skip < RuntimeError; end class NotFound < RuntimeError attr_reader :log def initialize(msg, log) @log = log super(msg) end end def initialize(host, skip) @host = host @skip = skip @cover = false end def self.find!(log) yaml = YAML.safe_load(File.read('.fitting.yml')) yaml['hosts']&.map do |host| if log.host == host.first.first return new(host.first.first, host.first.last) end end raise NotFound.new(log.host, log) end def cover! @cover = true raise Skip if @skip == 'skip' end def to_s @host end end end
Version data entries
8 entries across 8 versions & 1 rubygems