14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/tagistrano/tagging.rb', line 14
def ask_for_tag
next_tags = Tagistrano::Tag.next_tags
puts "\nTag: (leave blank to skip tagging)".underline
prompt = "\n1. Major \#{next_tags.first}\n2. Minor \#{next_tags.second}\n3. Patch \#{next_tags.third}\n prompt\n\n ask(prompt, '')\n\n option = fetch(prompt)\n\n if [\"1\", \"2\", \"3\", \"\"].include?(option.strip)\n option.to_i > 0 ? next_tags[option.to_i - 1] : nil\n else\n puts \"Didn't get 1, 2, 3 or blank\".colorize(:red)\n ask_for_tag\n end\nend\n"
|