Class: V::Adapters::Git::Tag

Inherits:
ObjectType show all
Defined in:
lib/v/adapters/git/object_types/tag.rb

Instance Method Summary collapse

Methods inherited from ObjectType

#===, ===, #to_s

Instance Method Details

#commit(object) ⇒ Object

Returns the commit the object points to.



13
14
15
# File 'lib/v/adapters/git/object_types/tag.rb', line 13

def commit(object)
  Commit.with object.environment, :name => object.content
end

#content(obj) ⇒ Object

Returns the name of the commit the object points to.



7
8
9
10
# File 'lib/v/adapters/git/object_types/tag.rb', line 7

def content(obj)
  path = File.join obj.environment.git_dir, %w[ refs tags ], obj.name
  File.read(path).chomp
end