Class: ReleaseCeremony::Prepare

Inherits:
Object
  • Object
show all
Extended by:
Command
Defined in:
lib/release_ceremony/prepare.rb

Overview

Prepares a release on its release-vVERSION branch: updates the version file, dates the changelog, and runs the verification commands. Never commits or pushes.

Constant Summary collapse

USAGE =
'Usage: release_ceremony prepare VERSION'
HELP =
<<~TEXT.freeze
  #{USAGE}

  Prepare VERSION on its release-vVERSION branch, update the release files,
  and run the release checks. This command does not commit or push changes.
TEXT
VERSION_DECLARATION =
/^[ \t]*VERSION[ \t]*=/
VERSION_ASSIGNMENT =
/^(?<indent>[ \t]*)VERSION = '(?<current>[^'\r\n]+)'[ \t]*$/

Instance Method Summary collapse

Methods included from Command

run

Constructor Details

#initialize(version:, runner:, project: nil, today: Date.today, writer: TransactionalWriter.new) ⇒ Prepare

Returns a new instance of Prepare.



23
24
25
26
27
28
29
# File 'lib/release_ceremony/prepare.rb', line 23

def initialize(version:, runner:, project: nil, today: Date.today, writer: TransactionalWriter.new)
  @version = version
  @runner = runner
  @project = project || Project.discover(runner: runner)
  @today = today
  @writer = writer
end

Instance Method Details

#callObject



31
32
33
34
35
36
37
# File 'lib/release_ceremony/prepare.rb', line 31

def call
  Dir.chdir(project.root) { prepare_release }
  print_next_steps
  true
rescue SystemCallError => e
  raise Error, e.message
end