Sha256: 2cc17a0e194410ea281ad7bedcb4c545b399828e071b731d804a52bbc0fc8798

Contents?: true

Size: 681 Bytes

Versions: 9

Compression:

Stored size: 681 Bytes

Contents

module MetricFu
  class Reporter
    def initialize(formatters = nil)
      @formatters = Array(formatters)
    end

    def start
      notify :start
    end

    def finish
      notify :finish
    end

    def start_metric(metric)
      mf_log "** STARTING METRIC #{metric}"
      notify :start_metric, metric
    end

    def finish_metric(metric)
      mf_log "** ENDING METRIC #{metric}"
      notify :finish_metric, metric
    end

    def display_results
      notify :display_results
    end

    protected

    def notify(event, *args)
      @formatters.each do |formatter|
        formatter.send(event, *args) if formatter.respond_to?(event)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
metric_fu-4.13.0 lib/metric_fu/reporter.rb
fastruby-metric_fu-5.0.0 lib/metric_fu/reporter.rb
code_metric_fu-4.14.4 lib/metric_fu/reporter.rb
code_metric_fu-4.14.3 lib/metric_fu/reporter.rb
code_metric_fu-4.14.2 lib/metric_fu/reporter.rb
code_metric_fu-4.14.1 lib/metric_fu/reporter.rb
code_metric_fu-4.14.0 lib/metric_fu/reporter.rb
metric_fu-4.12.0 lib/metric_fu/reporter.rb
metric_fu-4.11.4 lib/metric_fu/reporter.rb