class CreateGithubRelease::Tasks::UpdateVersion


@api public
Update the gem version using gem-version-boss

def increment_version

Other tags:
    Api: - private

Returns:
  • (void) -
def increment_version
  command = "gem-version-boss next-#{project.release_type}"
  command += ' --pre' if project.pre
  command += " --pre-type=#{project.pre_type}" if project.pre_type
  `#{command}`
  error 'Could not increment version' unless $CHILD_STATUS.success?
end

def run

Raises:
  • (SystemExit) - if the task fails

Returns:
  • (void) -
def run
  return if project.first_release?
  print 'Updating version...'
  increment_version
  stage_version_file
end

def stage_version_file

Other tags:
    Api: - private

Returns:
  • (void) -
def stage_version_file
  `git add "#{version_file}"`
  if $CHILD_STATUS.success?
    puts 'OK'
  else
    error "Could not stage changes to #{version_file}"
  end
end

def version_file

Other tags:
    Api: - private

Returns:
  • (String) -
def version_file
  output = `gem-version-boss file`
  error 'Could determine the version file' unless $CHILD_STATUS.success?
  output.lines.last.chomp
end