Sha256: 394d28ff14178b4d67fe05f55ef64faa67a4936935563bb4081f934eea1396d8

Contents?: true

Size: 730 Bytes

Versions: 12

Compression:

Stored size: 730 Bytes

Contents

module BenchmarkDriver
  module Output
    require 'benchmark_driver/output/compare'
    require 'benchmark_driver/output/markdown'
    require 'benchmark_driver/output/record'
    require 'benchmark_driver/output/simple'
  end

  class << Output
    # BenchmarkDriver::Output is pluggable.
    # Create `BenchmarkDriver::Output::Foo` as benchmark_dirver-output-foo.gem and specify `-o foo`.
    #
    # @param [String] type
    def find(type)
      if type.include?(':')
        raise ArgumentError.new("Output type '#{type}' cannot contain ':'")
      end

      ::BenchmarkDriver::Output.const_get(camelize(type), false)
    end

    private

    def camelize(str)
      str.split('_').map(&:capitalize).join
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
benchmark_driver-0.10.11 lib/benchmark_driver/output.rb
benchmark_driver-0.10.10 lib/benchmark_driver/output.rb
benchmark_driver-0.10.9 lib/benchmark_driver/output.rb
benchmark_driver-0.10.8 lib/benchmark_driver/output.rb
benchmark_driver-0.10.7 lib/benchmark_driver/output.rb
benchmark_driver-0.10.6 lib/benchmark_driver/output.rb
benchmark_driver-0.10.5 lib/benchmark_driver/output.rb
benchmark_driver-0.10.4 lib/benchmark_driver/output.rb
benchmark_driver-0.10.3 lib/benchmark_driver/output.rb
benchmark_driver-0.10.2 lib/benchmark_driver/output.rb
benchmark_driver-0.10.1 lib/benchmark_driver/output.rb
benchmark_driver-0.10.0 lib/benchmark_driver/output.rb