Given the simple YAML file for localisation:
root:
label: 'Test'
account: 'Account'
add: 'Add'
local_folder: 'Local folder'
remote_folder: 'Remote folder'
status: 'Status'
subkey: 'Some value'
How can I add a comment to the end of line for some key programmatically in Ruby? I need to get something like:
root:
label: 'Test'
account: 'Account'
add: 'Add'
local_folder: 'Local folder' #Test comment
remote_folder: 'Remote folder'
status: 'Status'
subkey: 'Some value' #Test comment
Are there any other ways (may be using Linux sed) to accomplish this? My reason is to prepare the YAML file for further processing. (comments will act as labels for external tool to identify keys).
EDIT
more programmatically: