Class: CreateGithubRelease::Tasks::UpdateChangelog

Inherits:
CreateGithubRelease::TaskBase show all
Defined in:
lib/create_github_release/tasks/update_changelog.rb

Overview

Update the changelog file with changes made since the last release

Instance Attribute Summary

Attributes inherited from CreateGithubRelease::TaskBase

#project

Instance Method Summary collapse

Methods inherited from CreateGithubRelease::TaskBase

#backtick_debug?, #error, #initialize, #print, #puts

Methods included from BacktickDebug

#`

Constructor Details

This class inherits a constructor from CreateGithubRelease::TaskBase

Instance Method Details

#run

This method returns an undefined value.

Update the changelog file with changes made since the last release

The changes since the last release are determined by using git log of all changes after the previous release tag up to and including HEAD.

Examples:

require 'create_github_release'

options = CreateGithubRelease::CommandLine::Options.new { |o| o.release_type = 'major' }
project = CreateGithubRelease::Project.new(options)
task = CreateGithubRelease::Tasks::UpdateChangelog.new(project)
begin
  task.run
  puts 'Task completed successfully'
rescue SystemExit
  puts 'Task failed'
end

Raises:

  • (SystemExit)

    if the task fails



36
37
38
39
# File 'lib/create_github_release/tasks/update_changelog.rb', line 36

def run
  update_changelog
  stage_updated_changelog
end