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
object
pointed at by this tag annotation, as aRugged::Object
instance. -
#target_id ⇒ Object
Return the oid pointed at by this tag annotation, as a
String
instance. -
#target_oid ⇒ Object
Return the oid pointed at by this tag annotation, as a
String
instance. -
#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
32 33 34 |
# File 'lib/rugged/tag.rb', line 32 def self.(msg, strip_comments = true) Rugged::(msg, strip_comments) end |
Instance Method Details
#inspect ⇒ Object
36 37 38 |
# 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 ⇒ 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'"
136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'ext/rugged/rugged_tag.c', line 136 static VALUE (VALUE self) { git_tag *tag; const char *; TypedData_Get_Struct(self, git_tag, &rugged_object_type, tag); = (tag); if (!) return Qnil; return rb_str_new_utf8(); } |
#modify(new_args, force = True) ⇒ Object
49 50 51 52 |
# 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 ⇒ Object
Return a string with the name of this tag annotation
.
annotation.name #=> "v0.16.0"
95 96 97 98 99 100 101 |
# File 'ext/rugged/rugged_tag.c', line 95 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 ⇒ 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"}
113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'ext/rugged/rugged_tag.c', line 113 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
Return the object
pointed at by this tag annotation, as a Rugged::Object
instance.
annotation.target #=> #<Rugged::Commit:0x108828918>
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'ext/rugged/rugged_tag.c', line 29 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_oid ⇒ Object #target_id ⇒ Object
Return the oid pointed at by this tag annotation, as a String
instance.
annotation.target_id #=> "2cb831a8aea28b2c1b9c63385585b864e4d3bad1"
55 56 57 58 59 60 61 62 63 64 65 |
# File 'ext/rugged/rugged_tag.c', line 55 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); } |
#target_oid ⇒ Object #target_id ⇒ Object
Return the oid pointed at by this tag annotation, as a String
instance.
annotation.target_id #=> "2cb831a8aea28b2c1b9c63385585b864e4d3bad1"
55 56 57 58 59 60 61 62 63 64 65 |
# File 'ext/rugged/rugged_tag.c', line 55 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); } |
#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
79 80 81 82 83 84 85 |
# File 'ext/rugged/rugged_tag.c', line 79 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 ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/rugged/tag.rb', line 40 def to_hash { :message => , :name => name, :target => target, :tagger => tagger, } end |