Class: Gempilot::GithubRelease

Inherits:
Object
  • Object
show all
Includes:
StrictShell
Defined in:
lib/gempilot/github_release.rb

Overview

Manages GitHub releases for a version tag. Tags naming a prerelease version (e.g. v1.2.4.dev1) are created as GitHub prereleases.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ GithubRelease

Returns a new instance of GithubRelease.



9
10
11
# File 'lib/gempilot/github_release.rb', line 9

def initialize(tag)
  @tag = tag
end

Instance Attribute Details

#tagObject (readonly)

Returns the value of attribute tag.



7
8
9
# File 'lib/gempilot/github_release.rb', line 7

def tag
  @tag
end

Instance Method Details

#createObject



13
14
15
16
17
18
# File 'lib/gempilot/github_release.rb', line 13

def create
  sh "gh", "release", "create",
     "--generate-notes", "--fail-on-no-commits",
     *prerelease_flag,
     tag
end

#destroyObject



20
21
22
23
24
# File 'lib/gempilot/github_release.rb', line 20

def destroy
  sh "gh", "release", "delete",
     "--yes", "--cleanup-tag",
     tag
end

#listObject



26
27
28
# File 'lib/gempilot/github_release.rb', line 26

def list
  sh "gh", "release", "list"
end