Class: Knapsack::AllocatorBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/knapsack/allocator_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(adapter_class) ⇒ AllocatorBuilder

Returns a new instance of AllocatorBuilder.



3
4
5
6
# File 'lib/knapsack/allocator_builder.rb', line 3

def initialize(adapter_class)
  @adapter_class = adapter_class
  set_report_path
end

Instance Method Details

#allocatorObject



8
9
10
11
12
13
14
15
# File 'lib/knapsack/allocator_builder.rb', line 8

def allocator
  Knapsack::Allocator.new({
    report: Knapsack.report.open,
    test_file_pattern: test_file_pattern,
    ci_node_total: Knapsack::Config::Env.ci_node_total,
    ci_node_index: Knapsack::Config::Env.ci_node_index
  })
end

#test_dirObject



17
18
19
# File 'lib/knapsack/allocator_builder.rb', line 17

def test_dir
  Knapsack::Config::Env.test_dir || test_file_pattern.split('/').first
end