Module: Prick::Git::Tag
- Defined in:
- lib/prick/local/git.rb
Class Method Summary collapse
-
.create(tag, id: nil) ⇒ Object
Create tag.
-
.current(id = nil) ⇒ Object
Return the most recent tag before the given commit (defaults to the last commit).
-
.drop(tag) ⇒ Object
Drop a tag.
-
.exist?(tag) ⇒ Boolean
True if tag exists.
-
.id(tag) ⇒ Object
The associated commit ID of a tag.
-
.list ⇒ Object
Return list of all tags.
Class Method Details
.create(tag, id: nil) ⇒ Object
Create tag
80 81 82 |
# File 'lib/prick/local/git.rb', line 80 def self.create(tag, id: nil) Command.command "git tag '#{tag}' #{id}" end |
.current(id = nil) ⇒ Object
Return the most recent tag before the given commit (defaults to the last commit)
96 97 98 |
# File 'lib/prick/local/git.rb', line 96 def self.current(id = nil) describe_tag(id)&.first end |
.drop(tag) ⇒ Object
Drop a tag
85 86 87 |
# File 'lib/prick/local/git.rb', line 85 def self.drop(tag) Command.command "git tag -d '#{tag}'" end |
.exist?(tag) ⇒ Boolean
True if tag exists
75 76 77 |
# File 'lib/prick/local/git.rb', line 75 def self.exist?(tag) tag && Command.command?("git describe --tags #{tag}") end |