class Papa::Task::Base

Public Instance Methods

run() click to toggle source
# File lib/papa/task/base.rb, line 9
def run
  perform_task
  result
end

Private Instance Methods

build_branch() click to toggle source
# File lib/papa/task/base.rb, line 30
def build_branch
  @build_branch ||= "#{@build_type}/#{@version}"
end
check_if_build_branch_exists() click to toggle source
# File lib/papa/task/base.rb, line 34
def check_if_build_branch_exists
  queue = [
    Command::Git::Fetch.new('origin'),
    Command::Git::Checkout.new(build_branch)
  ]
  runner = Runner.new(queue)
  return if runner.run
  Helper::Output.failure 'Build branch does not exist.'
  exit 1
end
perform_task() click to toggle source
# File lib/papa/task/base.rb, line 16
def perform_task
  runner = Runner.new(queue)
  @success = runner.run
end
result() click to toggle source
# File lib/papa/task/base.rb, line 21
def result
  if @success
    success_message
  else
    failure_message
    exit 1
  end
end