class GGem::CLI::TagCommand

Public Instance Methods

help() click to toggle source
# File lib/ggem/cli/commands.rb, line 322
def help
  "Usage: ggem tag [options]\n\n" \
  "Options: #{@clirb}\n" \
  "Description:\n" \
  "  #{summary}"
end
run(argv, *args) click to toggle source
Calls superclass method
# File lib/ggem/cli/commands.rb, line 286
def run(argv, *args)
  super

  begin
    cmd{ @repo.run_validate_clean_cmd }
    cmd{ @repo.run_validate_committed_cmd }
  rescue GGem::GitRepo::CmdError
    @stderr.puts "There are files that need to be committed first."
    if clirb.opts["force-tag"]
      @stderr.puts "Forcing tag anyway..."
    else
      raise CommandExitError
    end
  end

  cmd{ @repo.run_add_version_tag_cmd(@spec.version, @spec.version_tag) }

  @stdout.puts "Tagged #{@spec.version_tag}."

  begin
    cmd{ @repo.run_push_cmd }
  rescue
    cmd{ @repo.run_rm_tag_cmd(@spec.version_tag) }
    raise
  end

  @stdout.puts "Pushed git commits and tags."
rescue GGem::GitRepo::CmdError => ex
  @stderr.puts ex.message
  raise CommandExitError
end
summary() click to toggle source
# File lib/ggem/cli/commands.rb, line 318
def summary
  "Tag #{@spec.version_tag} and push git commits/tags"
end