Skip to content

Instantly share code, notes, and snippets.

Created November 24, 2011 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4f6d4ff6966feb2372b5 to your computer and use it in GitHub Desktop.
Save anonymous/4f6d4ff6966feb2372b5 to your computer and use it in GitHub Desktop.
# We do not allow '#' in tags. Aside from that, we will pretty much
# allow anything. For now, just keep things simple.
# raw: string to be parsed in tags
# returns a list of filtered tags
def parse_tags(raw)
tags = raw.split('#')
tags.reject! {|v| v.empty? }
tags.map! {|v| v.strip().downcase() }
tags.uniq!
tags
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment