Created
September 25, 2015 02:23
-
-
Save echohn/f258589f845642dc4fe0 to your computer and use it in GitHub Desktop.
ruby convert xml to yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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