Class: Rugged::Tag::Annotation
- Inherits:
-
RuggedObject
- Object
- RuggedObject
- Rugged::Tag::Annotation
- Defined in:
- lib/rugged/tag.rb,
ext/rugged/rugged_tag.c
Class Method Summary collapse
Instance Method Summary collapse
- #inspect ⇒ Object
-
#message ⇒ Object
Return the message of this tag
annotation. - #modify(new_args, force = True) ⇒ Object
-
#name ⇒ Object
Return a string with the name of this tag
annotation. -
#tagger ⇒ Object
Return the signature for the author of this tag
annotation. -
#target ⇒ Object
Return the
objectpointed at by this tag annotation, as aRugged::Objectinstance. -
#target_id ⇒ Object
Return the oid pointed at by this tag annotation, as a
Stringinstance. -
#target_oid ⇒ Object
Return the oid pointed at by this tag annotation, as a
Stringinstance. -
#type ⇒ Object
Return a symbol representing the type of the objeced pointed at by this
annotation. - #to_hash ⇒ Object
Class Method Details
.prettify_message(msg, strip_comments = true) ⇒ Object
8 9 10 |
# File 'lib/rugged/tag.rb', line 8 def self.(msg, strip_comments = true) Rugged::(msg, strip_comments) end |
Instance Method Details
#inspect ⇒ Object
12 13 14 |
# File 'lib/rugged/tag.rb', line 12 def inspect "#<Rugged::Tag::Annotation:#{object_id} {name: #{name.inspect}, message: #{message.inspect}, target: #{target.inspect}>" end |
#message ⇒ Object
Return the message of this tag annotation. This includes the full body of the message and any optional footers or signatures after it.
annotation. #=> "Release v0.16.0, codename 'broken stuff'"
151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'ext/rugged/rugged_tag.c', line 151 static VALUE (VALUE self) { git_tag *tag; const char *; Data_Get_Struct(self, git_tag, tag); = (tag); if (!) return Qnil; return rb_str_new_utf8(); } |
#modify(new_args, force = True) ⇒ Object
25 26 27 28 |
# File 'lib/rugged/tag.rb', line 25 def modify(new_args, force=True) args = self.to_hash.merge(new_args) Tag.create(args, force) end |
#name ⇒ Object
Return a string with the name of this tag annotation.
annotation.name #=> "v0.16.0"
110 111 112 113 114 115 116 |
# File 'ext/rugged/rugged_tag.c', line 110 static VALUE rb_git_tag_annotation_name(VALUE self) { git_tag *tag; Data_Get_Struct(self, git_tag, tag); return rb_str_new_utf8(git_tag_name(tag)); } |
#tagger ⇒ Object
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=>"[email protected]", :time=>Tue Jan 24 05:42:45 UTC 2012, :name=>"Vicent Mart\303\255"}
128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'ext/rugged/rugged_tag.c', line 128 static VALUE rb_git_tag_annotation_tagger(VALUE self) { git_tag *tag; const git_signature *tagger; Data_Get_Struct(self, git_tag, tag); tagger = git_tag_tagger(tag); if (!tagger) return Qnil; return rugged_signature_new(tagger, NULL); } |
#target ⇒ Object
Return the object pointed at by this tag annotation, as a Rugged::Object instance.
annotation.target #=> #<Rugged::Commit:0x108828918>
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'ext/rugged/rugged_tag.c', line 44 static VALUE rb_git_tag_annotation_target(VALUE self) { git_tag *tag; git_object *target; int error; VALUE owner; Data_Get_Struct(self, git_tag, tag); owner = rugged_owner(self); error = git_tag_target(&target, tag); rugged_exception_check(error); return rugged_object_new(owner, target); } |
#target_oid ⇒ Object #target_id ⇒ Object
Return the oid pointed at by this tag annotation, as a String instance.
annotation.target_id #=> "2cb831a8aea28b2c1b9c63385585b864e4d3bad1"
70 71 72 73 74 75 76 77 78 79 80 |
# File 'ext/rugged/rugged_tag.c', line 70 static VALUE rb_git_tag_annotation_target_id(VALUE self) { git_tag *tag; const git_oid *target_oid; Data_Get_Struct(self, git_tag, tag); target_oid = git_tag_target_id(tag); return rugged_create_oid(target_oid); } |
#target_oid ⇒ Object #target_id ⇒ Object
Return the oid pointed at by this tag annotation, as a String instance.
annotation.target_id #=> "2cb831a8aea28b2c1b9c63385585b864e4d3bad1"
70 71 72 73 74 75 76 77 78 79 80 |
# File 'ext/rugged/rugged_tag.c', line 70 static VALUE rb_git_tag_annotation_target_id(VALUE self) { git_tag *tag; const git_oid *target_oid; Data_Get_Struct(self, git_tag, tag); target_oid = git_tag_target_id(tag); return rugged_create_oid(target_oid); } |
#type ⇒ Object
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
94 95 96 97 98 99 100 |
# File 'ext/rugged/rugged_tag.c', line 94 static VALUE rb_git_tag_annotation_target_type(VALUE self) { git_tag *tag; Data_Get_Struct(self, git_tag, tag); return rugged_otype_new(git_tag_target_type(tag)); } |
#to_hash ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/rugged/tag.rb', line 16 def to_hash { :message => , :name => name, :target => target, :tagger => tagger, } end |