Sha256: ab7910b523ef9b718a3e3e04941e59352ca423afd7c1fabc3c91f0085c1d404e
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
require "logger" module RSpec module Parallel # Stores runtime configuration information. # # @!attribute concurrency # @return [Integer] class Configuration DEFULT_AFTER_FORK = ->(_worker) {} def after_fork(&block) @after_fork_block = block_given? ? block : DEFULT_AFTER_FORK end def after_fork_block @after_fork_block ||= DEFULT_AFTER_FORK end # @return [Integer] def concurrency @concurrency ||= if File.exist?("/proc/cpuinfo") File.read("/proc/cpuinfo").split("\n").grep(/processor/).size elsif RUBY_PLATFORM =~ /darwin/ `/usr/sbin/sysctl -n hw.activecpu`.to_i else 2 end end # @return [Logger] def logger @logger ||= Logger.new(STDERR).tap do |logger| logger.level = log_level end end # @return [Integer] def log_level @log_level ||= Logger::WARN end attr_writer :concurrency, :logger, :log_level end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
parallel-rspec-0.1.0 | lib/rspec/parallel/configuration.rb |