ruby / rake

A make-like build utility for Ruby.
https://ruby.github.io/rake
MIT License
2.32k stars 614 forks source link

Remove dependency on `win32ole` #573

Closed Earlopain closed 1 month ago

Earlopain commented 1 month ago

This gem is being bundled in Ruby 3.5: https://github.com/ruby/ruby/commit/f365bef0c78085b7db9b6736ae59c1657baa79a3

So, just use buildin commands to do the same thing.

The powershell version will work on at least Windows 8 (from 2012). There are no docs I could find for earlier versions, so it might work on even earlier versions. https://learn.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.4. Fall back to the deprecated wmic if it doesn't exist.

I have openen https://github.com/grosser/parallel/pull/346 and https://github.com/ruby-concurrency/concurrent-ruby/pull/1051 which do the same thing.

hsbt commented 1 month ago

Thanks 👍 I confirmed your powershell script is working correctly.

hsbt@FISCHER C:\Users\hsbt\source\ruby.build\2022>powershell -command "Get-CimInstance -ClassName Win32_Processor -Property NumberOfCores | Select-Object -Property NumberOfCores"

NumberOfCores
-------------
            8