Sha256: cea0bd84e732ba37c475a37acc47df5b446b76e0c7e84cab106fd5a16468e857

Contents?: true

Size: 603 Bytes

Versions: 26

Compression:

Stored size: 603 Bytes

Contents

module SimpleCov
  module Formatter
    class MultiFormatter
      def self.[](*args)
        Class.new(self) do
          define_method :formatters do
            @formatters ||= args
          end
        end
      end

      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

      def formatters
        @formatters ||= []
      end
    end
  end
end

Version data entries

26 entries across 23 versions & 7 rubygems

Version Path
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/simplecov-0.9.2/lib/simplecov/formatter/multi_formatter.rb
tdiary-5.0.7 vendor/bundle/gems/simplecov-0.9.2/lib/simplecov/formatter/multi_formatter.rb
tdiary-5.0.6 vendor/bundle/gems/simplecov-0.9.2/lib/simplecov/formatter/multi_formatter.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/simplecov-0.9.2/lib/simplecov/formatter/multi_formatter.rb
tdiary-5.0.5 vendor/bundle/gems/simplecov-0.9.2/lib/simplecov/formatter/multi_formatter.rb
tdiary-5.0.4 vendor/bundle/gems/simplecov-0.9.2/lib/simplecov/formatter/multi_formatter.rb
tdiary-5.0.2 vendor/bundle/gems/simplecov-0.9.2/lib/simplecov/formatter/multi_formatter.rb
tdiary-5.0.1 vendor/bundle/gems/simplecov-0.9.2/lib/simplecov/formatter/multi_formatter.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/simplecov-0.9.0/lib/simplecov/formatter/multi_formatter.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/simplecov-0.9.0/lib/simplecov/formatter/multi_formatter.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/simplecov-0.9.0/lib/simplecov/formatter/multi_formatter.rb
suzuko-0.1.8 vendor/bundle/ruby/2.0.0/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb
suzuko-0.1.7 vendor/bundle/ruby/2.0.0/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/simplecov-0.10.0/lib/simplecov/formatter/multi_formatter.rb