Sha256: 26831cd9c65f417bff80f3718e7c9e0a55f44c8ab82532762637eb272cab4c71

Contents?: true

Size: 759 Bytes

Versions: 7

Compression:

Stored size: 759 Bytes

Contents

module Knapsack
  class AllocatorBuilder
    def initialize(adapter_class)
      @adapter_class = adapter_class
      set_report_path
    end

    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

    private

    def set_report_path
      Knapsack.report.config({
        report_path: report_path
      })
    end

    def report_path
      Knapsack::Config::Env.report_path || @adapter_class::REPORT_PATH
    end

    def test_file_pattern
      Knapsack::Config::Env.test_file_pattern || @adapter_class::TEST_DIR_PATTERN
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
knapsack-1.1.1 lib/knapsack/allocator_builder.rb
knapsack-1.1.0 lib/knapsack/allocator_builder.rb
knapsack-1.0.4 lib/knapsack/allocator_builder.rb
knapsack-1.0.3 lib/knapsack/allocator_builder.rb
knapsack-1.0.2 lib/knapsack/allocator_builder.rb
knapsack-1.0.1 lib/knapsack/allocator_builder.rb
knapsack-1.0.0 lib/knapsack/allocator_builder.rb