Module: NativePackageInstaller::Platform

Defined in:
lib/native-package-installer/platform.rb,
lib/native-package-installer/platform/suse.rb,
lib/native-package-installer/platform/msys2.rb,
lib/native-package-installer/platform/debian.rb,
lib/native-package-installer/platform/fedora.rb,
lib/native-package-installer/platform/redhat.rb,
lib/native-package-installer/platform/freebsd.rb,
lib/native-package-installer/platform/unknown.rb,
lib/native-package-installer/platform/homebrew.rb,
lib/native-package-installer/platform/macports.rb,
lib/native-package-installer/platform/alt-linux.rb,
lib/native-package-installer/platform/pld-linux.rb,
lib/native-package-installer/platform/arch-linux.rb

Defined Under Namespace

Classes: ALTLinux, ArchLinux, Debian, Fedora, FreeBSD, Homebrew, MSYS2, MacPorts, PLDLinux, RedHat, SUSE, Unknown

Constant Summary collapse

PLATFORM_CLASSES =
[]

Class Method Summary collapse

Class Method Details

.detectObject


25
26
27
28
29
30
31
# File 'lib/native-package-installer/platform.rb', line 25

def detect
  platform_class = PLATFORM_CLASSES.find do |platform_class|
    platform_class.current_platform?
  end
  platform_class ||= Unknown
  platform_class.new
end

.register(platform_class) ⇒ Object


21
22
23
# File 'lib/native-package-installer/platform.rb', line 21

def register(platform_class)
  PLATFORM_CLASSES << platform_class
end