Sha256: aa47aed5b3f85dd2f92c6f6af83337cd989370fe8e88b5f71c5c719a4d9ab21c

Contents?: true

Size: 731 Bytes

Versions: 31

Compression:

Stored size: 731 Bytes

Contents

require 'shellwords'

module BenchmarkDriver
  module Rbenv
    # @param [String] version
    def self.ruby_path(version)
      path = `RBENV_VERSION='#{version}' rbenv which ruby`.rstrip
      unless $?.success?
        abort "Failed to execute 'rbenv which ruby'"
      end
      path
    end

    # @param [String] full_spec - "2.5.0", "2.5.0,--jit", "JIT::2.5.0,--jit", etc.
    def self.parse_spec(full_spec)
      name, spec = full_spec.split('::', 2)
      spec ||= name # if `::` is not given, regard whole string as spec
      version, *args = spec.shellsplit
      BenchmarkDriver::Config::Executable.new(
        name: name,
        command: [BenchmarkDriver::Rbenv.ruby_path(version), *args],
      )
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
benchmark_driver-0.15.7 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.15.6 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.15.5 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.15.4 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.15.3 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.15.2 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.15.1 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.15.0 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.22 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.21 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.20 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.19 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.18 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.17 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.16 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.15 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.14 lib/benchmark_driver/rbenv.rb
benchmark_driver_monotonic_raw-0.14.13 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.13 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.14.12 lib/benchmark_driver/rbenv.rb