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 = <<-prompt
1. Major #{next_tags.first}
2. Minor #{next_tags.second}
3. Patch #{next_tags.third}
prompt
ask(prompt, '')
option = fetch(prompt)
if ["1", "2", "3", ""].include?(option.strip)
option.to_i > 0 ? next_tags[option.to_i - 1] : nil
else
puts "Didn't get 1, 2, 3 or blank".colorize(:red)
ask_for_tag
end
end
|