Class: Ukiryu::ExecutableLocator::PathExtensions Private
- Inherits:
-
Object
- Object
- Ukiryu::ExecutableLocator::PathExtensions
- Includes:
- Enumerable
- Defined in:
- lib/ukiryu/executable_locator.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Handle platform-specific path extensions (.exe, .bat, etc.)
On Windows, prioritizes .exe over .com for better PowerShell compatibility. The .com extension is legacy and can cause issues with PowerShell’s call operator when used with I/O redirection (hangs with Open3.capture3).
Constant Summary collapse
- PREFERRED_WINDOWS_EXTENSIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Extensions to prioritize on Windows for PowerShell compatibility .com files can hang PowerShell when used with I/O redirection
%w[.exe .EXE].freeze
Instance Method Summary collapse
-
#each {|String| ... } ⇒ Object
private
Iterate over extensions.
-
#initialize ⇒ PathExtensions
constructor
private
A new instance of PathExtensions.
Constructor Details
#initialize ⇒ PathExtensions
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PathExtensions.
332 333 334 335 |
# File 'lib/ukiryu/executable_locator.rb', line 332 def initialize raw_extensions = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] @extensions = prioritize_extensions(raw_extensions) end |
Instance Method Details
#each {|String| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Iterate over extensions
340 341 342 |
# File 'lib/ukiryu/executable_locator.rb', line 340 def each(&block) @extensions.each(&block) end |