Sha256: d78b3495a663cfc05503dc657f11640cb730250eb3a9b97e570872fb8fd18ba1

Contents?: true

Size: 580 Bytes

Versions: 4

Compression:

Stored size: 580 Bytes

Contents

require 'gem_release/helpers'

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

4 entries across 4 versions & 1 rubygems

Version Path
gem-release-0.0.12 lib/rubygems/commands/tag_command.rb
gem-release-0.0.11 lib/rubygems/commands/tag_command.rb
gem-release-0.0.10 lib/rubygems/commands/tag_command.rb
gem-release-0.0.9 lib/rubygems/commands/tag_command.rb