Class: Benchmark::Driver::Configuration::Executable

Inherits:
Struct
  • Object
show all
Defined in:
lib/benchmark/driver/configuration.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#commandObject

Returns the value of attribute command

Returns:

  • (Object)

    the current value of command



25
26
27
# File 'lib/benchmark/driver/configuration.rb', line 25

def command
  @command
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



25
26
27
# File 'lib/benchmark/driver/configuration.rb', line 25

def name
  @name
end

Class Method Details

.parse(name_path) ⇒ Object



26
27
28
29
# File 'lib/benchmark/driver/configuration.rb', line 26

def self.parse(name_path)
  name, path = name_path.split('::', 2)
  Benchmark::Driver::Configuration::Executable.new(name, path ? path.split(',') : [name])
end

.parse_rbenv(spec) ⇒ Object



31
32
33
34
35
36
# File 'lib/benchmark/driver/configuration.rb', line 31

def self.parse_rbenv(spec)
  version, *args = spec.split(',')
  path = `RBENV_VERSION='#{version}' rbenv which ruby`.rstrip
  abort "Failed to execute 'rbenv which ruby'" unless $?.success?
  Benchmark::Driver::Configuration::Executable.new(version, [path, *args])
end