Skip to content

Instantly share code, notes, and snippets.

@jlbfalcao
Created July 10, 2012 10:53
Show Gist options
  • Save jlbfalcao/3082642 to your computer and use it in GitHub Desktop.
Save jlbfalcao/3082642 to your computer and use it in GitHub Desktop.
Getting x.y.z-release from a git-tag
data = %x{git log -n 1 --decorate --pretty=oneline}.match(/tag: (?<version>\d+\.\d+\.\d+)-(?<release>\w+)/)
data[:version]
data[:release]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment