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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ GithubRelease

Returns a new instance of GithubRelease.



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

def initialize(tag)
  @tag = tag
end

Instance Attribute Details

#tagObject (readonly)

Returns the value of attribute tag.



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

def tag
  @tag
end

Instance Method Details

#createObject



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

def create
  sh "git", "push"
  sh "git", "push", "--tags"
  sh "gh", "release", "create",
     "--generate-notes", "--fail-on-no-commits",
     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