Class: GemPublisher::GitRemote
- Inherits:
-
Object
- Object
- GemPublisher::GitRemote
- Defined in:
- lib/gem_publisher/git_remote.rb
Instance Method Summary collapse
- #add_tag(tag_name, commit_ish = "HEAD") ⇒ Object
-
#initialize(name = "origin", cli_facade = CliFacade.new) ⇒ GitRemote
constructor
A new instance of GitRemote.
- #tags ⇒ Object
Constructor Details
Instance Method Details
#add_tag(tag_name, commit_ish = "HEAD") ⇒ Object
15 16 17 18 19 |
# File 'lib/gem_publisher/git_remote.rb', line 15 def add_tag(tag_name, commit_ish = "HEAD") sha1 = git("rev-parse", commit_ish).chomp git "update-ref", "refs/tags/#{tag_name}", sha1 git "push", @remote_name, "tag", tag_name end |
#tags ⇒ Object
10 11 12 13 |
# File 'lib/gem_publisher/git_remote.rb', line 10 def s = git("ls-remote", "--tags", @remote_name) s.scan(%r{refs/tags/(.+)}).map(&:first).reject { |t| t =~ /\^\{\}$/ } end |