Class: Gem::Release::Cmds::Tag

Inherits:
Base
  • Object
show all
Defined in:
lib/gem/release/cmds/tag.rb

Constant Summary collapse

DEFAULTS =
{
  push:   false,
  remote: 'origin',
  sign:   false
}.freeze
DESCR =
{
  push:   'Push tag to the remote git repository',
  remote: 'Git remote to push to',
  sign:   'GPG sign the tag',
}.freeze
MSGS =
{
  tag:       'Tagging %s as version %s',
  exists:    'Skipping %s, tag already exists.',
  git_tag:   'Creating git tag %s',
  git_push:  'Pushing tags to the %s git repository',
  no_remote: 'Cannot push to missing git remote %s',
  git_dirty: 'Uncommitted changes found. Please commit or stash.',
}.freeze
CMDS =
{
  git_tag:   'git tag -am "tag %s" %s %s',
  git_push:  'git push --tags %s'
}.freeze

Constants inherited from Base

Base::WIDTH

Constants included from Helper::Hash

Helper::Hash::MERGER

Instance Attribute Summary

Attributes inherited from Base

#args, #context, #gem, #opts

Instance Method Summary collapse

Methods inherited from Base

arg, args, #config, default, #defaults, descr, description, #in_dirs, #in_gem_dirs, inherited, #initialize, opt, opts, #pretend?, #quiet?, summary, usage

Methods included from Helper::String

#camelize, #underscore, #wrap

Methods included from Helper

#abort, #cmd, #gem_cmd

Methods included from Helper::Hash

#deep_merge, #except, #only, #symbolize_keys

Methods included from Registry

included

Constructor Details

This class inherits a constructor from Gem::Release::Cmds::Base

Instance Method Details

#runObject



64
65
66
67
68
69
70
# File 'lib/gem/release/cmds/tag.rb', line 64

def run
  in_gem_dirs do
    announce :tag, gem.name, target_version
    validate
    tag_and_push
  end
end