Module: RbConfig

Defined in:
lib/framework/rbconfig.rb

Overview

This file was created by mkconfig.rb when ruby was built. Any changes made to this file will be lost the next time ruby is built.

Constant Summary collapse

CONFIG =
{}
MAKEFILE_CONFIG =
{}

Class Method Summary collapse

Class Method Details

.expand(val, config = CONFIG) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/framework/rbconfig.rb', line 40

def RbConfig::expand(val, config = CONFIG)
  newval = val.gsub(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) {
    var = $&
    if !(v = $1 || $2)
	'$'
    elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]]
	pat, sub = $1, $2
	config[v] = false
	config[v] = RbConfig::expand(key, config)
	key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat
	key
    else
	var
    end
  }
  val.replace(newval) unless newval == val
  val
end

.rubyObject

returns the absolute pathname of the ruby command.



63
64
65
66
67
68
# File 'lib/framework/rbconfig.rb', line 63

def RbConfig.ruby
  File.join(
    RbConfig::CONFIG["bindir"],
    RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
  )
end