Skip to content

Instantly share code, notes, and snippets.

Created February 12, 2010 08:48
Show Gist options
  • Save anonymous/302424 to your computer and use it in GitHub Desktop.
Save anonymous/302424 to your computer and use it in GitHub Desktop.
tags = "blue:1,red:2,purple:3"
output = {}
tags.split(/,/).each{|i|o=i.split(/:/); output[o[0]]=o[1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment