Class: BenchTool::Dispatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/benchtool/dispatcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Dispatcher

Returns a new instance of Dispatcher.



4
5
6
7
8
9
10
11
12
13
# File 'lib/benchtool/dispatcher.rb', line 4

def initialize(options = {})
  @appconfig = AppConfig.new.to_hash
  @config = @appconfig[:configuration]
  @targets = @appconfig[:targets]
  @options = options
  # Overwrite app config with options (usually passed as CLI options)
  unless options.nil?
    @config.merge!(options)
  end
end

Instance Method Details

#benchmarkObject

Each command gets a method here



17
18
19
20
# File 'lib/benchtool/dispatcher.rb', line 17

def benchmark
  setup_output
  benchmark_target(select_target)
end

#testObject



22
23
24
# File 'lib/benchtool/dispatcher.rb', line 22

def test
  test_target(select_target)
end