Sha256: 3db04b70d795b2900a8636cd858ba7766215c6e53777df008faab7028d206a23

Contents?: true

Size: 989 Bytes

Versions: 8

Compression:

Stored size: 989 Bytes

Contents

require 'benchmark_driver/struct'

module BenchmarkDriver
  DefaultJob = ::BenchmarkDriver::Struct.new(
    :name,       # @param [String] name - This is mandatory for all runner
    :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_execs(executables)
      if required_ruby_version
        executables.select do |executable|
          Gem::Version.new(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
        executables
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
benchmark_driver-0.11.1 lib/benchmark_driver/default_job.rb
benchmark_driver-0.11.0 lib/benchmark_driver/default_job.rb
benchmark_driver-0.10.16 lib/benchmark_driver/default_job.rb
benchmark_driver-0.10.15 lib/benchmark_driver/default_job.rb
benchmark_driver-0.10.14 lib/benchmark_driver/default_job.rb
benchmark_driver-0.10.13 lib/benchmark_driver/default_job.rb
benchmark_driver-0.10.12 lib/benchmark_driver/default_job.rb
benchmark_driver-0.10.11 lib/benchmark_driver/default_job.rb