Skip to content

Commit 308d7f4

Browse files
committed
[GR-18163] Improve the script to compare RbConfig
PullRequest: truffleruby/2726
2 parents 1efa532 + e5849fd commit 308d7f4

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

tool/compare-rbconfig.rb

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,23 @@
1717

1818
File.open("#{RUBY_ENGINE}.txt", "w") do |f|
1919
f.puts RUBY_VERSION
20-
[RbConfig::CONFIG, RbConfig::MAKEFILE_CONFIG].each do |h|
21-
h.keys.sort.each { |k| f.puts "#{k} = #{h[k]}" }
20+
21+
prefix = RbConfig::CONFIG['prefix']
22+
toolchain_path = RbConfig::CONFIG['toolchain_path']
23+
24+
{
25+
# 'RbConfig::CONFIG' => RbConfig::CONFIG,
26+
'RbConfig::MAKEFILE_CONFIG' => RbConfig::MAKEFILE_CONFIG
27+
}.each do |name, h|
28+
f.puts
29+
f.puts name
30+
h.keys.sort.each { |k|
31+
value = h[k]
32+
33+
value = value.gsub(prefix, '$(prefix)')
34+
value = value.gsub(toolchain_path, '$(toolchain_path)') if toolchain_path
35+
36+
f.puts "#{k} = #{value}"
37+
}
2238
end
2339
end

0 commit comments

Comments
 (0)