Sha256: 2e4eba9c16646797d01ff10d39cd36bbb9225f2904b807e281971fbea62f306e
Contents?: true
Size: 352 Bytes
Versions: 22
Compression:
Stored size: 352 Bytes
Contents
# frozen_string_literal: true require 'etc' module Switchman class Environment def self.cpu_count(nproc_bin = "nproc") if Etc.respond_to?(:nprocessors) return Etc.nprocessors end return `#{nproc_bin}`.to_i rescue Errno::ENOENT # an environment where nproc` isnt available return 0 end end end
Version data entries
22 entries across 22 versions & 1 rubygems