Class: Ukiryu::ExecutableLocator::PathExtensions Private

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializePathExtensions

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

Yields:

  • (String)

    each extension



340
341
342
# File 'lib/ukiryu/executable_locator.rb', line 340

def each(&block)
  @extensions.each(&block)
end