Sha256: d263f314b6153fc5072c2890c08c279959ff6d357ddb31539699274ba0786f97

Contents?: true

Size: 709 Bytes

Versions: 15

Compression:

Stored size: 709 Bytes

Contents

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.split(',')
      BenchmarkDriver::Config::Executable.new(
        name: name,
        command: [BenchmarkDriver::Rbenv.ruby_path(version), *args],
      )
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
benchmark_driver-0.13.3 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.13.2 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.13.1 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.13.0 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.12.0 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.11.1 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.11.0 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.10.16 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.10.15 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.10.14 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.10.13 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.10.12 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.10.11 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.10.10 lib/benchmark_driver/rbenv.rb
benchmark_driver-0.10.9 lib/benchmark_driver/rbenv.rb