Sha256: cf6915e6d12a5e7875e36e969b2011acb4e645d174dd5c9b56e1324ce0da1454
Contents?: true
Size: 805 Bytes
Versions: 15
Compression:
Stored size: 805 Bytes
Contents
# frozen_string_literal: true module SimpleCov module Formatter class MultiFormatter module InstanceMethods def format(result) formatters.map do |formatter| formatter.new.format(result) rescue StandardError => e warn("Formatter #{formatter} failed with #{e.class}: #{e.message} (#{e.backtrace.first})") nil end end end def self.new(formatters = nil) Class.new do define_method :formatters do @formatters ||= Array(formatters) end include InstanceMethods end end def self.[](*args) warn "#{Kernel.caller.first}: [DEPRECATION] ::[] is deprecated. Use ::new instead." new(Array(args)) end end end end
Version data entries
15 entries across 14 versions & 8 rubygems