Class: KnapsackPro::QueueAllocator
- Inherits:
-
Object
- Object
- KnapsackPro::QueueAllocator
- Defined in:
- lib/knapsack_pro/queue_allocator.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ QueueAllocator
constructor
A new instance of QueueAllocator.
- #test_file_paths(can_initialize_queue) ⇒ Object
Constructor Details
#initialize(args) ⇒ QueueAllocator
Returns a new instance of QueueAllocator.
3 4 5 6 7 8 9 |
# File 'lib/knapsack_pro/queue_allocator.rb', line 3 def initialize(args) @test_files = args.fetch(:test_files) @ci_node_total = args.fetch(:ci_node_total) @ci_node_index = args.fetch(:ci_node_index) @ci_node_build_id = args.fetch(:ci_node_build_id) @repository_adapter = args.fetch(:repository_adapter) end |
Instance Method Details
#test_file_paths(can_initialize_queue) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/knapsack_pro/queue_allocator.rb', line 11 def test_file_paths(can_initialize_queue) action = build_action(can_initialize_queue) connection = KnapsackPro::Client::Connection.new(action) response = connection.call if connection.success? raise ArgumentError.new(response) if connection.errors? prepare_test_files(response) else raise ArgumentError.new("Couldn't connect with Knapsack Pro API. Response: #{response}") end end |