Skip to content

Fixes to the Test Suite, and a Dependency Refactor#147

Open
kkohrt wants to merge 7 commits intorails:masterfrom
kkohrt:kgk_260406_internal_dependency_refactor
Open

Fixes to the Test Suite, and a Dependency Refactor#147
kkohrt wants to merge 7 commits intorails:masterfrom
kkohrt:kgk_260406_internal_dependency_refactor

Conversation

@kkohrt
Copy link
Copy Markdown

@kkohrt kkohrt commented May 6, 2026

A recent cleanup PR removed a redundant accessor from a file (module.rb) that actually used it, which made it hard to follow the code path.
It was ultimately a final step in a chain of cleanup actions in execjs.rb.
This PR basically unwinds a much earlier refactor of execjs.rb here that was written so that:

You can now load ExecJS and bypass engine autodetection by requiring "execjs/runtimes" instead of "execjs".

But that same problem was re-addressed here in order to:

prevent runtime autodetect on require

which now left module methods defined in two places :-(

This PR

  • Glues it all back together again into an single module definition

  • Fixes some predicate methods to return false, not nil

  • Fixes a warning in the test suite

  • Uses File.join rather than concatenating strings for path definitions (since Windows is supported?)

  • Does some quick fixes on spec tests and CI config to get everything to pass ✅
    These could probably use some additional refinement, but I don't have the setup to do it locally hey! I think I got github actions running in my fork. I will try to tighten up the code wherever I can in the coming days; and happy to take any suggestions in the meantime.


NOTE:
A future TODO item would be to clean up this section of ExternalRuntime so that either (a) the switchard is inside a lightweight external_exec method than then calls either static or dynamically created platform-specific methods to actually do the work; or (b) external_exec is defined only when needed at runtime using method_missing, and again, executes the switchyard logic at that time rather than when the class is loaded.

@kkohrt kkohrt force-pushed the kgk_260406_internal_dependency_refactor branch from 1afba33 to 1e55731 Compare May 6, 2026 18:16
@kkohrt kkohrt changed the title Bugfixes and Dependency Refactor Fixes to the Test Suite, and a Dependency Refactor May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant