class NativePackageInstaller::Platform::MSYS2
Public Class Methods
Source
# File lib/native-package-installer/platform/msys2.rb, line 22 def current_platform? return false if package_prefix.nil? not pacman_path.nil? end
Source
# File lib/native-package-installer/platform/msys2.rb, line 42 def package_prefix case RUBY_PLATFORM when "i386-mingw32" "mingw-w64-i686-" when "x64-mingw32" "mingw-w64-x86_64-" when "x64-mingw-ucrt" "mingw-w64-ucrt-x86_64-" else nil end end
Source
# File lib/native-package-installer/platform/msys2.rb, line 27 def pacman_path finder = ExecutableFinder.new("pacman") case RUBY_PLATFORM when "i386-mingw32" Dir.glob("c:/msys{64,32,*}/usr/bin") do |bin| finder.append_path(bin) end when "x64-mingw32", "x64-mingw-ucrt" Dir.glob("c:/msys{64,*}/usr/bin") do |bin| finder.append_path(bin) end end finder.find end
Public Instance Methods
Source
# File lib/native-package-installer/platform/msys2.rb, line 63 def install_command pacman_dir, pacman = File.split(self.class.pacman_path) ENV["PATH"] = [pacman_dir, ENV["PATH"]].join(File::PATH_SEPARATOR) "#{pacman} -S --noconfirm" end
Source
# File lib/native-package-installer/platform/msys2.rb, line 69 def need_super_user_priviledge? false end
Source
# File lib/native-package-installer/platform/msys2.rb, line 56 def package(spec) base_name = spec[:msys2] return nil if base_name.nil? "#{self.class.package_prefix}#{base_name}" end