:symbolize_keys => true option doesn't symbolise inline tables
Closed this issue · 1 comments
filterfish commented
TOML.parse(config, :symbolize_keys => true)
should always symbolise the keys but it doesn't for inline tables as indicated by the following pry session:
[1] pry(main)> require 'toml'
=> true
[2] pry(main)> standard = %([amqp.exchange]\n durable = true\n auto_delete = false\n)
=> "[amqp.exchange]\n durable = true\n auto_delete = false\n"
[3] pry(main)> inline = %([amqp]\nexchange = {durable = true, auto_delete = false})
=> "[amqp]\nexchange = {durable = true, auto_delete = false}"
[4] pry(main)>
[5] pry(main)> TOML.parse(standard, :symbolize_keys => true)
=> {:amqp=>{:exchange=>{:durable=>true, :auto_delete=>false}}}
[6] pry(main)>
[7] pry(main)> TOML.parse(inline, :symbolize_keys => true)
=> {:amqp=>{:exchange=>{"durable"=>true, "auto_delete"=>false}}}
As you can see durable
and auto_delete
are strings when the table is defined inline.
emancu commented
@filterfish thanks for report it.
I'll fix it asap.