1 2 3 4 5 6 7
STDOUT.binmode ARGF.each do |line| line.gsub!(/@([a-z_]\w*)@/i) { (RbConfig::MAKEFILE_CONFIG[$1] or "").gsub(/\$\((.+?)\)/, %Q[${\\1}]) } puts line end