Sha256: 483b9203729851572229d4d32892de806f373d4730f2328c7fabec14f5ee56cb

Contents?: true

Size: 504 Bytes

Versions: 8

Compression:

Stored size: 504 Bytes

Contents

require 'whysoslow'
require 'scmd'

class ScmdBenchRunner

  attr_reader :result

  def self.run(*args)
    self.new(*args).run
  end

  def initialize(printer_io, cmd, num_times = 10)
    @cmd = cmd
    @proc = proc do
      num_times.times{ cmd.run! }
    end

    @printer = Whysoslow::DefaultPrinter.new(printer_io, {
      :title => "#{@cmd.cmd_str}: #{num_times} times",
      :verbose => true
    })
    @runner = Whysoslow::Runner.new(@printer)
  end

  def run
    @runner.run &@proc
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scmd-3.0.3 bench/runner.rb
scmd-3.0.2 bench/runner.rb
scmd-3.0.1 bench/runner.rb
scmd-3.0.0 bench/runner.rb
scmd-2.3.1 bench/runner.rb
scmd-2.3.0 bench/runner.rb
scmd-2.2.0 bench/runner.rb
scmd-2.1.2 bench/runner.rb