Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save developerinlondon/f37c0b5ab96e691ebb6e5d4ac6b5337b to your computer and use it in GitHub Desktop.
Save developerinlondon/f37c0b5ab96e691ebb6e5d4ac6b5337b to your computer and use it in GitHub Desktop.
ruby convert xml to yaml
require 'active_support/core_ext/hash/conversions'
require 'yaml'
file = File.open("data/mconvert.xml", "r")
hash = Hash.from_xml(file.read)
yaml = hash.to_yaml
File.open("data/mirador.yml", "w") { |file| file.write(yaml) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment