class Rugged::Tag::Annotation
Public Class Methods
Source
# File lib/rugged/tag.rb, line 32 def self.prettify_message(msg, strip_comments = true) Rugged::prettify_message(msg, strip_comments) end
Public Instance Methods
Source
# File lib/rugged/tag.rb, line 36 def inspect "#<Rugged::Tag::Annotation:#{object_id} {name: #{name.inspect}, message: #{message.inspect}, target: #{target.inspect}>" end
Source
static VALUE rb_git_tag_annotation_message(VALUE self)
{
git_tag *tag;
const char *message;
TypedData_Get_Struct(self, git_tag, &rugged_object_type, tag);
message = git_tag_message(tag);
if (!message)
return Qnil;
return rb_str_new_utf8(message);
}
Return the message of this tag annotation. This includes the full body of the message and any optional footers or signatures after it.
annotation.message #=> "Release v0.16.0, codename 'broken stuff'"
Source
# File lib/rugged/tag.rb, line 49 def modify(new_args, force=True) args = self.to_hash.merge(new_args) Tag.create(args, force) end
Source
static VALUE rb_git_tag_annotation_name(VALUE self)
{
git_tag *tag;
TypedData_Get_Struct(self, git_tag, &rugged_object_type, tag);
return rb_str_new_utf8(git_tag_name(tag));
}
Return a string with the name of this tag annotation.
annotation.name #=> "v0.16.0"
Source
static VALUE rb_git_tag_annotation_tagger(VALUE self)
{
git_tag *tag;
const git_signature *tagger;
TypedData_Get_Struct(self, git_tag, &rugged_object_type, tag);
tagger = git_tag_tagger(tag);
if (!tagger)
return Qnil;
return rugged_signature_new(tagger, NULL);
}
Return the signature for the author of this tag annotation. The signature is returned as a Hash containing :name, :email of the author and :time of the tagging.
annotation.tagger #=> {:email=>"tanoku@gmail.com", :time=>Tue Jan 24 05:42:45 UTC 2012, :name=>"Vicent Mart\303\255"}
Source
static VALUE rb_git_tag_annotation_target(VALUE self)
{
git_tag *tag;
git_object *target;
int error;
VALUE owner;
TypedData_Get_Struct(self, git_tag, &rugged_object_type, tag);
owner = rugged_owner(self);
error = git_tag_target(&target, tag);
rugged_exception_check(error);
return rugged_object_new(owner, target);
}
Return the object pointed at by this tag annotation, as a Rugged::Object instance.
annotation.target #=> #<Rugged::Commit:0x108828918>
Return the oid pointed at by this tag annotation, as a String instance.
annotation.target_id #=> "2cb831a8aea28b2c1b9c63385585b864e4d3bad1"
Source
static VALUE rb_git_tag_annotation_target_id(VALUE self)
{
git_tag *tag;
const git_oid *target_oid;
TypedData_Get_Struct(self, git_tag, &rugged_object_type, tag);
target_oid = git_tag_target_id(tag);
return rugged_create_oid(target_oid);
}
Return the oid pointed at by this tag annotation, as a String instance.
annotation.target_id #=> "2cb831a8aea28b2c1b9c63385585b864e4d3bad1"
Source
static VALUE rb_git_tag_annotation_target_type(VALUE self)
{
git_tag *tag;
TypedData_Get_Struct(self, git_tag, &rugged_object_type, tag);
return rugged_otype_new(git_tag_target_type(tag));
}
Return a symbol representing the type of the objeced pointed at by this annotation. Possible values are :blob, :commit, :tree and :tag.
This is always the same as the type of the returned annotation.target
annotation.type #=> :commit annotation.target.type == annotation.type #=> true
Source
# File lib/rugged/tag.rb, line 40 def to_hash { :message => message, :name => name, :target => target, :tagger => tagger, } end