I am writing data to yaml files from ruby and I frequently get aliases dotted about the file. Things like:
- &id001
somekey: somevalue
- *id001
In my case I am using the yaml files to aid readability and add names to values in the files as the existing data is just |
separated values with no keys. How can I prevent the yaml files being written with aliases?
[Edit]
For further clarification here is an example of the type of data and problem.
The original data looks like:
Ham|2.00|1
Eggs|0.50|12
Milk|2.00|2
And I have written a ruby script to convert it to yaml, which also looks at an sql file to get the appropriate names. The yaml file looks like:
---
- !omap
- name: Ham
- &id001
price: 2.00
- quantity: 1
- !omap
- name: Eggs
- price: 0.50
- quantity: 12
- !omap
- name: Milk
- *id001
- quantity: 1
This causes a problem in large data sets because the aliases may be nowhere near each other and it makes it hard to read.