Sha256: dd38202618dc0658662182f64f34a5ed662b10e011187ae2e7d3863b5bae6e66

Contents?: true

Size: 607 Bytes

Versions: 2

Compression:

Stored size: 607 Bytes

Contents

require 'gem_release/helpers'

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

  attr_reader :arguments, :usage

  def initialize
    super 'tag', 'Create a git tag and push --tags to origin'
    @arguments = '' 
    @usage = "#{program_name}"
  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

2 entries across 2 versions & 1 rubygems

Version Path
gem-release-0.0.8 lib/rubygems/commands/tag_command.rb
gem-release-0.0.7 lib/rubygems/commands/tag_command.rb