All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jruby.kernel.rbconfig.rb Maven / Gradle / Ivy

There is a newer version: 9.4.9.0
Show newest version

module RbConfig
  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
end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy