Top Level Namespace

Defined Under Namespace

Modules: Tagistrano

Instance Method Summary collapse

Instance Method Details

#ask_for_tagObject



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"

#tag_releaseObject



6
7
8
9
10
11
12
# File 'lib/tagistrano/tagging.rb', line 6

def tag_release
  if tag = ask_for_tag.presence
    puts "\nTagging as #{tag}\n\n".colorize(:green)
    `git tag #{tag}`
    `git push --tags`
  end
end