s P5J 2^|[YARB 1$x86_64-linux447  8 9 y ^4":!\7    \> ?+;]7\8  a  19뢩8  Y M> ?47    -- 4!4! 4!> ? 4; 497  *,3567\> ?+;7\8  #  좩7 $7  (  8 I  .7 A e e .!>  ?4;7>  ?aB47    15 kAe 1 ]9 EJ/home/pdrowr/.rvm/gems/ruby-2.5.1/gems/rake-12.3.1/lib/rake/cpu_counter.rbE
E EEcountEcount_with_default Erescue in count_with_defaultEetcErescue in E require 'rbconfig' def count if defined?(Java::Java) count_via_java_runtime else case RbConfig::CONFIG['host_os'] when /linux/ count_via_cpuinfo when /darwin|bsd/ count_via_sysctl when /mswin|mingw/ count_via_win32 else # Try everything count_via_win32 || count_via_sysctl || count_via_cpuinfo end end end def count_via_java_runtime Java::Java.lang.Runtime.getRuntime.availableProcessors rescue StandardError nil end def count_via_win32 require 'win32ole' wmi = WIN32OLE.connect("winmgmts://") cpu = wmi.ExecQuery("select NumberOfCores from Win32_Processor") # TODO count hyper-threaded in this cpu.to_enum.first.NumberOfCores rescue StandardError, LoadError nil end def count_via_cpuinfo open('/proc/cpuinfo') { |f| f.readlines }.grep(/processor/).size rescue StandardError nil end def count_via_sysctl run 'sysctl', '-n', 'hw.ncpu' end def run(command, *args) cmd = resolve_command(command) if cmd IO.popen [cmd, *args] do |io| io.read.to_i end else nil end end def resolve_command(command) look_for_command("/usr/sbin", command) || look_for_command("/sbin", command) || in_path_command(command) end def look_for_command(dir, command) path = File.join(dir, command) File.exist?(path) ? path : nil end def in_path_command(command) IO.popen ['which', command] do |io| io.eof? ? nil : command end end ?ERakeE CpuCounterEnewEdefaultE StandardErrorE#$!EEtcE nprocessorsE LoadErrorEcore#define_singleton_methodEcore#define_methodErequireE respond_to?Emethod_defined?E+E class_eval3Mn'>Jz?Kc!>n