class Gem::Tasks::SCM::Tag

def tag!(name)

Other tags:
    Api: - semipublic

Returns:
  • (Boolean) -

Parameters:
  • name (String) --
def tag!(name)
  message = "Tagging #{name}"
  case @project.scm
  when :git then
    arguments = ['-m', message]
    arguments << '-s' if sign?
    arguments << name
    run 'git', 'tag', *arguments
  when :hg  then
    if sign?
      # sign the change-set, then tag the release
      run 'hg', 'sign', '-m', "Signing #{name}"
    end
    run 'hg', 'tag', '-m', message, name
  when :svn
    branch   = File.basename(@project.root)
    tags_dir = if branch == 'trunk'
                 # we are in trunk/
                 File.join('..','tags')
               else
                 # must be within branches/$name/
                 File.join('..','..','tags')
               end
    tag_dir = File.join(tag_dirs,name)
    run 'svn', 'mkdir', '--parents', tag_dir
    run 'svn', 'cp', '*', tag_dir
    run 'svn', 'commit', '-m', message, tag_dir
  else
    true
  end
end