class Rugged::Tag::Annotation

Public Class Methods

prettify_message(msg, strip_comments = true) click to toggle 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

inspect() click to toggle 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
message → msg click to toggle source

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'"
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);
}
modify(new_args, force=True) click to toggle 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
name → name click to toggle source

Return a string with the name of this tag annotation.

annotation.name #=> "v0.16.0"
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));
}
tagger → signature click to toggle source

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"}
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);
}
target → object click to toggle source

Return the object pointed at by this tag annotation, as a Rugged::Object instance.

annotation.target #=> #<Rugged::Commit:0x108828918>
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);
}
target_id → oid

Return the oid pointed at by this tag annotation, as a String instance.

annotation.target_id #=> "2cb831a8aea28b2c1b9c63385585b864e4d3bad1"
Alias for: target_oid
target_oid → oid click to toggle source

Return the oid pointed at by this tag annotation, as a String instance.

annotation.target_id #=> "2cb831a8aea28b2c1b9c63385585b864e4d3bad1"
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);
}
Also aliased as: target_id
type → t click to toggle source

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
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));
}
to_hash() click to toggle source
# File lib/rugged/tag.rb, line 40
def to_hash
  {
    :message => message,
    :name => name,
    :target => target,
    :tagger => tagger,
  }
end