class Grit::Ref
Attributes
commit[R]
name[R]
Public Class Methods
find_all(repo, options = {})
click to toggle source
Find all Refs
+repo+ is the Repo +options+ is a Hash of options
Returns Grit::Ref
[] (baked)
# File lib/grit/lib/grit/ref.rb, line 12 def find_all(repo, options = {}) refs = repo.git.refs(options, prefix) refs.split("\n").map do |ref| name, id = *ref.split(' ') commit = Commit.create(repo, :id => id) self.new(name, commit) end end
new(name, commit)
click to toggle source
Instantiate a new Head
+name+ is the name of the head +commit+ is the Commit that the head points to
Returns Grit::Head
(baked)
# File lib/grit/lib/grit/ref.rb, line 37 def initialize(name, commit) @name = name @commit = commit end
Protected Class Methods
prefix()
click to toggle source
# File lib/grit/lib/grit/ref.rb, line 23 def prefix "refs/#{name.to_s.gsub(/^.*::/, '').downcase}s" end
Public Instance Methods
inspect()
click to toggle source
Pretty object inspection
# File lib/grit/lib/grit/ref.rb, line 43 def inspect %Q{#<#{self.class.name} "#{@name}">} end