Sha256: 693f62b335ff5129afe2bd9c256b40ae13e11061a0da9198f668b245c264b774

Contents?: true

Size: 812 Bytes

Versions: 37

Compression:

Stored size: 812 Bytes

Contents

module SimpleCov
  module Formatter
    class MultiFormatter
      module InstanceMethods
        def format(result)
          formatters.map do |formatter|
            begin
              formatter.new.format(result)
            rescue => e
              STDERR.puts("Formatter #{formatter} failed with #{e.class}: #{e.message} (#{e.backtrace.first})")
              nil
            end
          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

37 entries across 37 versions & 10 rubygems

Version Path
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/lib/simplecov/formatter/multi_formatter.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/lib/simplecov/formatter/multi_formatter.rb
tdiary-5.0.9 vendor/bundle/gems/simplecov-0.14.1/lib/simplecov/formatter/multi_formatter.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/formatter/multi_formatter.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/formatter/multi_formatter.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/formatter/multi_formatter.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/formatter/multi_formatter.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/formatter/multi_formatter.rb
simplecov-0.15.1 lib/simplecov/formatter/multi_formatter.rb
simplecov-0.15.0 lib/simplecov/formatter/multi_formatter.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/formatter/multi_formatter.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/formatter/multi_formatter.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/formatter/multi_formatter.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/formatter/multi_formatter.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simplecov-0.14.1/lib/simplecov/formatter/multi_formatter.rb
simplecov-patched-0.14.3 lib/simplecov/formatter/multi_formatter.rb
simplecov-patched-0.14.2 lib/simplecov/formatter/multi_formatter.rb
simplecov-0.14.1 lib/simplecov/formatter/multi_formatter.rb
simplecov-0.14.0 lib/simplecov/formatter/multi_formatter.rb
simplecov-0.13.0 lib/simplecov/formatter/multi_formatter.rb