class Hippo::RepositoryTag

Public Class Methods

new(options) click to toggle source
# File lib/hippo/repository_tag.rb, line 5
def initialize(options)
  @options = options
end

Public Instance Methods

branch() click to toggle source
# File lib/hippo/repository_tag.rb, line 9
def branch
  @options['branch'] || 'master'
end
tag() click to toggle source
# File lib/hippo/repository_tag.rb, line 13
def tag
  @tag ||= commit_ref_for_branch(branch)
end
to_s() click to toggle source
# File lib/hippo/repository_tag.rb, line 17
def to_s
  tag
end

Private Instance Methods

commit_ref_for_branch(branch) click to toggle source
# File lib/hippo/repository_tag.rb, line 23
def commit_ref_for_branch(branch)
  return nil if remote_refs.nil?

  remote_refs.dig('branches', branch, :sha)
end
remote_refs() click to toggle source
# File lib/hippo/repository_tag.rb, line 29
def remote_refs
  return nil if @options['url'].nil?

  @remote_refs ||= begin
    Util.action "Getting remote refs from #{@options['url']}..." do
      Git.ls_remote(@options['url'])
    end
  end
end