Sha256: 3c13ac96a06e417703778c1b459044398a45bd9b84c87a07a7a603979d59c689

Contents?: true

Size: 544 Bytes

Versions: 3

Compression:

Stored size: 544 Bytes

Contents

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

  attr_reader :arguments, :usage

  def initialize
    super 'tag', 'Create a git tag and push --tags to origin'
  end

  def execute
    tag
    push
  end

  protected

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

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

    def tag_name
      "v#{gem_version}"
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gem-release-0.0.16 lib/rubygems/commands/tag_command.rb
gem-release-0.0.15 lib/rubygems/commands/tag_command.rb
gem-release-0.0.14 lib/rubygems/commands/tag_command.rb