class Gitx::Cli::BuildtagCommand

Constants

BUILD_TAG_PREFIX
BUILD_TAG_SEPARATOR

Public Instance Methods

buildtag() click to toggle source
# File lib/gitx/cli/buildtag_command.rb, line 14
def buildtag
  raise "Branch must be one of the supported taggable branches: #{config.taggable_branches}" unless config.taggable_branch?(branch_name)

  run_git_cmd 'tag', build_tag, '--annotate', '--message', label
  run_git_cmd 'push', 'origin', build_tag
end

Private Instance Methods

branch_name() click to toggle source
# File lib/gitx/cli/buildtag_command.rb, line 23
def branch_name
  options[:branch] || current_branch.name
end
build_tag() click to toggle source
# File lib/gitx/cli/buildtag_command.rb, line 31
def build_tag
  @build_tag ||= [
    BUILD_TAG_PREFIX,
    branch_name,
    utc_timestamp
  ].join(BUILD_TAG_SEPARATOR)
end
label() click to toggle source
# File lib/gitx/cli/buildtag_command.rb, line 27
def label
  options[:message] || "[gitx] buildtag for #{branch_name}"
end
utc_timestamp() click to toggle source
# File lib/gitx/cli/buildtag_command.rb, line 39
def utc_timestamp
  Time.now.utc.strftime '%Y-%m-%d-%H-%M-%S'
end