Sha256: 180646f6099ece4868e9707a0cd42f8a287b6567772899eb09e42ffa18aa99e6

Contents?: true

Size: 673 Bytes

Versions: 5

Compression:

Stored size: 673 Bytes

Contents

module Knapsack
  module Config
    class Env
      class << self
        def report_path
          ENV['KNAPSACK_REPORT_PATH']
        end

        def ci_node_total
          ENV['CI_NODE_TOTAL'] || ENV['CIRCLE_NODE_TOTAL'] || ENV['SEMAPHORE_THREAD_COUNT'] || 1
        end

        def ci_node_index
          ENV['CI_NODE_INDEX'] || ENV['CIRCLE_NODE_INDEX'] || semaphore_current_thread || 0
        end

        def test_file_pattern
          ENV['KNAPSACK_TEST_FILE_PATTERN']
        end

        private

        def semaphore_current_thread
          index = ENV['SEMAPHORE_CURRENT_THREAD']
          index.to_i - 1 if index
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
knapsack-1.0.4 lib/knapsack/config/env.rb
knapsack-1.0.3 lib/knapsack/config/env.rb
knapsack-1.0.2 lib/knapsack/config/env.rb
knapsack-1.0.1 lib/knapsack/config/env.rb
knapsack-1.0.0 lib/knapsack/config/env.rb