Sha256: 0b2e08e39486fd4dc76d33cf8f873ecc0b4c94b4beef3f857d03d84677d664b9

Contents?: true

Size: 616 Bytes

Versions: 14

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true

module KnapsackPro
  class Queue
    include Enumerable

    def initialize
      @batches = []
    end

    def each(&block)
      @batches.each(&block)
    end

    def add_batch_for(test_file_paths)
      return if test_file_paths.empty?
      @batches << KnapsackPro::Batch.new(test_file_paths)
    end

    def mark_batch_passed
      current_batch._passed
    end

    def mark_batch_failed
      current_batch._failed
    end

    def current_batch
      @batches.last
    end

    def size
      @batches.size
    end

    def [](index)
      @batches[index]
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
knapsack_pro-7.13.1 lib/knapsack_pro/queue.rb
knapsack_pro-7.13.0 lib/knapsack_pro/queue.rb
knapsack_pro-7.12.1 lib/knapsack_pro/queue.rb
knapsack_pro-7.12.0 lib/knapsack_pro/queue.rb
knapsack_pro-7.11.0 lib/knapsack_pro/queue.rb
knapsack_pro-7.10.0 lib/knapsack_pro/queue.rb
knapsack_pro-7.9.0 lib/knapsack_pro/queue.rb
knapsack_pro-7.8.2 lib/knapsack_pro/queue.rb
knapsack_pro-7.8.1 lib/knapsack_pro/queue.rb
knapsack_pro-7.8.0 lib/knapsack_pro/queue.rb
knapsack_pro-7.7.0 lib/knapsack_pro/queue.rb
knapsack_pro-7.6.2 lib/knapsack_pro/queue.rb
knapsack_pro-7.6.1 lib/knapsack_pro/queue.rb
knapsack_pro-7.6.0 lib/knapsack_pro/queue.rb