Class: Grit::Tag

Inherits:
Ref
  • Object
show all
Defined in:
lib/grit/lib/grit/tag.rb

Instance Attribute Summary

Attributes inherited from Ref

#commit, #name

Class Method Summary collapse

Methods inherited from Ref

#initialize, #inspect

Constructor Details

This class inherits a constructor from Grit::Ref

Class Method Details

.find_all(repo, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/grit/lib/grit/tag.rb', line 4

def self.find_all(repo, options = {})
  refs = repo.git.refs(options, prefix)
  refs.split("\n").map do |ref|
    name, id = *ref.split(' ')
    cid = repo.git.commit_from_sha(id)
    raise "Unknown object type." if cid == ''
    commit = Commit.create(repo, :id => cid)
    self.new(name, commit)
  end
end