Closed
Description
Ruby is continuing its path of requiring more gems to be specified. win32ole
is next on the list (among others) and will start warning in Ruby 3.4: ruby/ruby@f365bef
Usage is here, to get the number of cores on windows:
Something like the following may be a suitable replacement:
IO.popen("wmic cpu get NumberOfCores", &:read).scan(/\d+/).map(&:to_i).reduce(:+)
Output of that command:
NumberOfCores \n\n4 \n\n\n\n
I have also openend the same report on parallel
at grosser/parallel#345 if you are interested. Both implementations for this are basically the same.
Metadata
Metadata
Assignees
Labels
No labels
Activity
win32ole
grosser/parallel#345eregon commentedon Jun 5, 2024
Thanks for the heads up. Could you make a PR with that?
Agreed it's better to stop needing win32ole than to add the dependency.
Earlopain commentedon Jun 5, 2024
I'll try to do that tomorrow. I just read that this tool is actually deprecated (though I have no idea how aggressive microsoft would be here), so first check via powershell
(Get-ComputerInfo).NumberOfCores
(currently untested) and fall back to wmic.CI doesn't run on windows at the moment. Would you mind me adding something for that to the matrix or is the exclusion intention?
win32ole
#1051