class RbSys::ToolchainInfo

RbSys::ToolchainInfo.new(“x86_64-unknown-linux-gnu”)
RbSys::ToolchainInfo.new(“x86_64-unknown-linux-gnu”).supported? # => true
RbSys::ToolchainInfo.new(“x86_64-unknown-linux-gnu”).ruby_platform # => “x86_64-linux”
@example
Ruby platforms.
A class to get information about the Rust toolchains, and how they map to

def ==(other)

Returns:
  • (Boolean) -

Parameters:
  • other (RbSys::ToolchainInfo) --
def ==(other)
  @gem_platform == other.gem_platform
end

def all

Returns:
  • (Array) -
def all
  @all ||= DATA.keys.map { |k| new(k) }
end

def initialize(platform)

Parameters:
  • platform (String) -- The platform to get information about.
def initialize(platform)
  @platform = platform
  @gem_platform = Gem::Platform.new(platform)
  data = DATA[platform] || DATA["#{gem_platform.cpu}-#{gem_platform.os}"] || raise(ArgumentError, "unknown ruby platform: #{platform.inspect}")
  @rust_target = data["rust-target"]
  @rake_compiler_dock_cc = data["rake-compiler-dock"]["cc"]
  @supported = data["supported"]
  @rake_compiler_dock_image = "rbsys/#{platform}:#{RbSys::VERSION}"
  @docker_platform = data["docker-platform"]
end

def local

Returns:
  • (RbSys::ToolchainInfo) -
def local
  @current ||= new(RbConfig::CONFIG["arch"])
end

def supported

Returns:
  • (Array) -
def supported
  @supported ||= all.select(&:supported?)
end

def supported?

Returns:
  • (Boolean) -
def supported?
  @supported
end

def supported_ruby_platforms

Returns:
  • (Array) -
def supported_ruby_platforms
  supported.map(&:platform)
end

def to_s

Returns:
  • (String) -
def to_s
  "#{gem_platform.cpu}-#{gem_platform.os}"
end