Skip to content

Commit 378e65a

Browse files
nobumatzbot
authored andcommitted
[rubygems/rubygems] Dump RbConfig elements to escape special characters
Naively embed strings do not work if special characters (newline, backslahes and so on) are contained. rubygems/rubygems@ac2c4c4af1
1 parent 2ccd5f8 commit 378e65a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/rubygems/test_gem_ext_builder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ def self.expand(val, config = CONFIG); val; end
323323
end
324324
RUBY
325325
RbConfig::CONFIG.each do |k, v|
326-
f.puts %(RbConfig::CONFIG["#{k}"] = "#{v}")
326+
f.puts %(RbConfig::CONFIG[#{k.dump}] = #{v.dump})
327327
end
328328
RbConfig::MAKEFILE_CONFIG.each do |k, v|
329-
f.puts %(RbConfig::MAKEFILE_CONFIG["#{k}"] = "#{v}")
329+
f.puts %(RbConfig::MAKEFILE_CONFIG[#{k.dump}] = #{v.dump})
330330
end
331331
f.puts "RbConfig::CONFIG['host_os'] = 'fake_os'"
332332
f.puts "RbConfig::CONFIG['arch'] = 'fake_arch'"

0 commit comments

Comments
 (0)