Class: CreateGithubRelease::ReleaseTasks

Inherits:
Object
  • Object
show all
Defined in:
lib/create_github_release/release_tasks.rb

Overview

Tasks that must be run to create a new Github release.

Examples:

require 'create_github_release'

options = CreateGithubRelease::Options.new { |o| o.release_type = 'major' }
tasks = CreateGithubRelease::ReleaseTasks.new(options)
tasks.run

Constant Summary collapse

TASKS =

The tasks that will be run to create a new Github release

The tasks are run in the order they are defined in this array.

Returns:

  • (Array<Class>)

    The tasks that will be run to create a new Github release

[
  CreateGithubRelease::Tasks::CreateReleaseBranch,
  CreateGithubRelease::Tasks::UpdateVersion,
  CreateGithubRelease::Tasks::UpdateChangelog,
  CreateGithubRelease::Tasks::CommitRelease,
  CreateGithubRelease::Tasks::CreateReleaseTag,
  CreateGithubRelease::Tasks::PushRelease,
  CreateGithubRelease::Tasks::CreateGithubRelease,
  CreateGithubRelease::Tasks::CreateReleasePullRequest
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ReleaseTasks

Create a new instance of ReleaseTasks

Examples:

require 'create_github_release'

options = CreateGithubRelease::Options.new { |o| o.release_type = 'major' }
tasks = CreateGithubRelease::ReleaseTasks.new(options)
tasks.run


39
40
41
# File 'lib/create_github_release/release_tasks.rb', line 39

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsCreateGithubRelease::CommandLine::Options (readonly)

The options used to create the Github release

Examples:

require 'create_github_release'

options = CreateGithubRelease::Options.new { |o| o.release_type = 'major' }
tasks = CreateGithubRelease::ReleaseTasks.new(options)
tasks.options # => #<CreateGithubRelease::Options:0x00007f9b0a0b0a00>

Returns:



28
29
30
# File 'lib/create_github_release/release_tasks.rb', line 28

def options
  @options
end

Instance Method Details

#run

This method returns an undefined value.

Run all tasks to create a new Github release

Examples:

require 'create_github_release'

options = CreateGithubRelease::Options.new { |o| o.release_type = 'major' }
tasks = CreateGithubRelease::ReleaseTasks.new(options)
tasks.run

Raises:

  • (SystemExit)

    if any task fails



72
73
74
75
76
77
# File 'lib/create_github_release/release_tasks.rb', line 72

def run
  TASKS.each do |task_class|
    # @sg-ignore
    task_class.new(options).run
  end
end