123456789_123456789_123456789_123456789_123456789_

Module: RubyInstaller::Build

Overview

Use for: Build, Runtime

Constant Summary

Class Method Summary

Class Method Details

.add_dll_directory(path, &block)

Add path as a search path for DLLs

This can be used to allow ruby extension files (typically named .so ) to import dependent DLLs from another directory.

If this method is called with a block, the path is temporary added until the block is finished. The method returns a Build::DllDirectory instance, when called without a block. It can be used to remove the directory later.

[ GitHub ]

  
# File 'lib/ruby_installer/build/singleton.rb', line 11

def add_dll_directory(path, &block)
  DllDirectory.new(path, &block)
end

.disable_msys_apps(**opts)

[ GitHub ]

  
# File 'lib/ruby_installer/build/singleton.rb', line 40

def disable_msys_apps(**opts)
  msys2_installation.disable_msys_apps(**opts)
end

.enable_dll_search_paths

Switch to explicit DLL search paths added by add_dll_directory(). Then enable paths set by RUBY_DLL_PATH environment variable and the MSYS2-MINGW directory, if available.

[ GitHub ]

  
# File 'lib/ruby_installer/build/singleton.rb', line 22

def enable_dll_search_paths
  ENV['RUBY_DLL_PATH'].to_s.split(File::PATH_SEPARATOR).each do |path|
    DllDirectory.new(path) rescue DllDirectory::Error
  end

  msys2_installation.enable_dll_search_paths
end

.enable_msys_apps(**opts)

Add MSYS2 to the PATH and set other environment variables required to run MSYS2.

This method tries to find a MSYS2 installation or exits with a description how to install MSYS2.

mingwarch should be either ‘mingw32’, ‘mingw64’ or nil. In the latter case the mingw architecture is used based on the architecture of the running Ruby process.

[ GitHub ]

  
# File 'lib/ruby_installer/build/singleton.rb', line 36

def enable_msys_apps(**opts)
  msys2_installation.enable_msys_apps(**opts)
end

.msys2_installation

This method is for internal use only.
[ GitHub ]

  
# File 'lib/ruby_installer/build/singleton.rb', line 16

def msys2_installation
  @msys2_installation ||= Msys2Installation.new
end