Sha256: c7ce802ab9dfe30103ae111efe8f57399ac15e4aba34cdca5254e5d4e383bb93

Contents?: true

Size: 709 Bytes

Versions: 12

Compression:

Stored size: 709 Bytes

Contents

class Gem::Commands::TagCommand < Gem::Command
  include GemRelease
  include Helpers, CommandOptions

  DEFAULTS = {
    :quiet => false
  }

  attr_reader :arguments, :usage

  def initialize(options = {})
    super 'tag', 'Create a git tag and push --tags to origin', DEFAULTS.merge(options)

    option :quiet, '-q', 'Do not output status messages'
  end

  def execute
    tag
    push
  end

  protected

    def tag
      say "Creating git tag #{tag_name}" unless quiet?
      `git tag -am 'tag #{tag_name}' #{tag_name}`
    end

    def push
      say "Pushing --tags to origin git repository" unless quiet?
      `git push --tags origin`
    end

    def tag_name
      "v#{gem_version}"
    end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gem-release-0.2.0 lib/rubygems/commands/tag_command.rb
gem-release-0.1.3 lib/rubygems/commands/tag_command.rb
gem-release-0.1.2 lib/rubygems/commands/tag_command.rb
gem-release-0.1.1 lib/rubygems/commands/tag_command.rb
gem-release-0.1.0 lib/rubygems/commands/tag_command.rb
gem-release-0.0.24 lib/rubygems/commands/tag_command.rb
gem-release-0.0.23 lib/rubygems/commands/tag_command.rb
gem-release-0.0.22 lib/rubygems/commands/tag_command.rb
gem-release-0.0.21 lib/rubygems/commands/tag_command.rb
gem-release-0.0.20 lib/rubygems/commands/tag_command.rb
gem-release-0.0.19 lib/rubygems/commands/tag_command.rb
gem-release-0.0.17 lib/rubygems/commands/tag_command.rb