Sha256: d3fb3d364cfcf3ca3930ef77b2ccaf83ef142118a930e5fcd3182487c50ef555

Contents?: true

Size: 1.18 KB

Versions: 52

Compression:

Stored size: 1.18 KB

Contents

require 'benchmark_driver/struct'

module BenchmarkDriver
  DefaultJob = ::BenchmarkDriver::Struct.new(
    :name,       # @param [String] name - This is mandatory for all runner
    :metrics,    # @param [Array<BenchmarkDriver::Metric>] - This is mandatory for all runner too, set by job parser.
    :contexts,   # @param [Array<BenchmarkDriver::Context>] - This is optional parameter for runners.
    :script,     # @param [String] benchmark
    :prelude,    # @param [String,nil] prelude (optional)
    :teardown,   # @param [String,nil] after (optional)
    :loop_count, # @param [Integer,nil] loop_count (optional)
    :required_ruby_version, # @param [String,nil] required_ruby_version (optional)
    defaults: { prelude: '', teardown: '' },
  ) do
    def runnable_contexts(contexts)
      if required_ruby_version
        contexts.select do |context|
          Gem::Version.new(context.executable.version) >= Gem::Version.new(required_ruby_version)
        end.tap do |result|
          if result.empty?
            raise "No Ruby executables conforming required_ruby_version (#{required_ruby_version}) are specified"
          end
        end
      else
        contexts
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
benchmark_driver-0.15.4 lib/benchmark_driver/default_job.rb
benchmark_driver-0.15.3 lib/benchmark_driver/default_job.rb
benchmark_driver-0.15.2 lib/benchmark_driver/default_job.rb
benchmark_driver-0.15.1 lib/benchmark_driver/default_job.rb
benchmark_driver-0.15.0 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.22 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.21 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.20 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.19 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.18 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.17 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.16 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.15 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.14 lib/benchmark_driver/default_job.rb
benchmark_driver_monotonic_raw-0.14.13 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.13 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.12 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.11 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.10 lib/benchmark_driver/default_job.rb
benchmark_driver-0.14.9 lib/benchmark_driver/default_job.rb