【发布时间】:2016-11-19 15:00:33
【问题描述】:
所以我有这个测试脚本
require 'yaml'
hashYaml = YAML::load_file("./monFichier.yaml")
puts "hashYaml : "
puts hashYaml
hashManuel = {enonce: "ma question", titre: "mon titre" }
puts "hashManuel : "
puts hashManuel
./monFichier.yaml 包含以下行:
- enonce: "ma question"
titre: "mon titre"
输出是:
hashYaml :
{"enonce"=>"ma question", "titre"=>"mon titre"}
hashManuel :
{:enonce=>"ma question", :titre=>"mon titre"}
谁能解释一下
- 为什么两条线不同?
- 如何获得与
hashManuel格式相同的hashYaml?
干杯,
【问题讨论】: