Class: Benchmark::Driver::Configuration

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

Overview

Defined Under Namespace

Classes: Executable, Job, OutputOptions, RunnerOptions

Constant Summary collapse

DEFAULT_EXECUTABLES =
[Executable.new(RUBY_VERSION, [RbConfig.ruby])]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#jobsObject

Returns the value of attribute jobs

Returns:

  • (Object)

    the current value of jobs



4
5
6
# File 'lib/benchmark/driver/configuration.rb', line 4

def jobs
  @jobs
end

#output_optionsObject

Returns the value of attribute output_options

Returns:

  • (Object)

    the current value of output_options



4
5
6
# File 'lib/benchmark/driver/configuration.rb', line 4

def output_options
  @output_options
end

#runner_optionsObject

Returns the value of attribute runner_options

Returns:

  • (Object)

    the current value of runner_options



4
5
6
# File 'lib/benchmark/driver/configuration.rb', line 4

def runner_options
  @runner_options
end

Class Method Details

.camelize(str) ⇒ Object

Parameters:

  • str (String)


73
74
75
76
# File 'lib/benchmark/driver/configuration.rb', line 73

def self.camelize(str)
  return str if str !~ /_/ && str =~ /[A-Z]+.*/
  str.split('_').map { |e| e.capitalize }.join
end

.symbolize_keys!(config) ⇒ Object

Parameters:

  • config (Object)


60
61
62
63
64
65
66
67
68
69
70
# File 'lib/benchmark/driver/configuration.rb', line 60

def self.symbolize_keys!(config)
  case config
  when Hash
    config.keys.each do |key|
      config[key.to_sym] = symbolize_keys!(config.delete(key))
    end
  when Array
    config.map! { |c| symbolize_keys!(c) }
  end
  config
end