Module: Jolt::Native::Platform

Defined in:
lib/jolt/native/platform.rb

Class Method Summary collapse

Class Method Details

.tag(cpu: RbConfig::CONFIG.fetch("host_cpu"), os: RbConfig::CONFIG.fetch("host_os")) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/jolt/native/platform.rb', line 10

def tag(cpu: RbConfig::CONFIG.fetch("host_cpu"), os: RbConfig::CONFIG.fetch("host_os"))
  case os
  when /darwin/
    "#{darwin_cpu(cpu)}-darwin"
  when /linux/
    "#{linux_cpu(cpu)}-linux"
  when /mswin|mingw/
    "#{windows_cpu(cpu)}-mingw-ucrt"
  else
    "#{cpu}-#{os}".downcase.gsub(/[^a-z0-9._-]+/, "-")
  end
end