Skip to content

Instantly share code, notes, and snippets.

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 awesome/bb7de78cc7ed918ac1625c35945f2760 to your computer and use it in GitHub Desktop.
Save awesome/bb7de78cc7ed918ac1625c35945f2760 to your computer and use it in GitHub Desktop.
format ticket title to git branch name
str = "ZZZ://ZZZZZZ (ZZZZ allocation - slider does not automatically reflect the entered Stop value and requires a click outside o
f the Stop input field)"
str.downcase.gsub(/\W/, '-').squeeze('-')[0..45].chomp('-')
# => "zzz-zzzzzz-zzzz-allocation-slider-does-not-aut"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment