Method: Gem::TargetRbConfig.from_path

Defined in:
lib/rubygems/target_rbconfig.rb

.from_path(rbconfig_path) ⇒ Object

Creates a TargetRbConfig from the RbConfig file at the given path. Typically used for cross-compiling gems.



33
34
35
36
37
38
39
40
41
42
# File 'lib/rubygems/target_rbconfig.rb', line 33

def self.from_path(rbconfig_path)
  namespace = Module.new do |m|
    # Load the rbconfig.rb file within a new anonymous module to avoid
    # conflicts with the rbconfig for the running platform.
    Kernel.load rbconfig_path, m
  end
  rbconfig = namespace.const_get(:RbConfig)

  new(rbconfig, rbconfig_path)
end