Skip to content

Instantly share code, notes, and snippets.

@RichGuk
Created May 21, 2010 13:41
Show Gist options
  • Save RichGuk/408842 to your computer and use it in GitHub Desktop.
Save RichGuk/408842 to your computer and use it in GitHub Desktop.
info = data.lines.map(&:strip).delete_if(&:empty?).inject([]) do |res, line|
split = line.split(':').map(&:strip)
split[1] = nil unless split[1]
res << split
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment