I am pulling recently the command from Gitob and trying to parse it via Ruby. I know I can parse it manually, but I want to see if there is a package that can turn it into a hash or other data structure.
Commit: - Parent: - ID: 202fb79e8686ee127fe49497c979cfc9c9d985d5 Author: Name: This man login: tguy email: tguy@tguy.com url: a url id: e466354edb31f243899051e2119f4ce72bafd5f3 CommittedDate: "2010-07 -19T13: 44: 43-07: 00 "Author:" 2010-07-19T13: 33: 26-07: 00 "Message: | - Message - Parent: - ID: c3c349ec3e9a3990cac4d256c308b18fd35d9606 Author: Name: Other Boys Login: Ogui Email: oguy@gmail.com url: Other URL ID: 202fb79e8686ee127fe49497c979cfc9c9d985d5 CommittedDate: "2010-07-19T13: 44: 11-07: 00" Author ":" 2010-07-19T13: 44: 11-07: 00 "message: this is another message
This is YAML, you can do something like obj = YAML :: load yaml_string (and a is required 'yaml' your file At the top, in its standard Libby), and then reach it Like bread hash.
YAML basically the way the world of Ruby are using Java / C # XML world.
Comments
Post a Comment