Repository navigation
Use Script Host before PowerShell for Windows parent query fallback - #920
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When optional
win32oleis unavailable, including Ruby 4.0, Windows hook contexts launch PowerShell to inspect their parent command. Query the same WMI field with Windows Script Host first, retaining PowerShell when the host is missing, disabled, fails, or produces invalid output. The helper validates the PID and decodes redirected UTF-16LE output, preserving complete Unicode command lines. Existinglibexec/**/*gem packaging includes it; no dependency is added.All five paired GitHub Windows/Ruby 4.0 shards improved: 7.1% aggregate and 9.4% median test-command reduction, with positive results in both execution orders. The slowest sampled shard fell from 55.9s to 50.7s. Benchmark.
Local verification: all 1,708 examples, RuboCop, JavaScript syntax, and gem packaging pass. New tests cover Unicode/BOM decoding, exited processes, missing Script Host, script failure, and malformed output. Full GitHub CI passed 10,248 executions across all six Ruby/OS pairs, lint, and required CI. Aggregate coverage increased to 92.442%. Two optional partial-shard comparisons shifted as five new tests redistributed later examples. The 138s workflow overlapped another run and is correctness evidence; final combined timing is measured separately on main.