Class: Tag
- Inherits:
-
Object
- Object
- Tag
- Defined in:
- lib/tag.rb
Overview
Represents a Git tag and its annotation.
Instance Attribute Summary collapse
-
#changelog ⇒ Object
readonly
Array of lines in the tag annotation that are changelog entries.
-
#date ⇒ Object
readonly
Author commit date of the tag.
-
#heading ⇒ Object
The heading of the tag annotation.
-
#text ⇒ Object
readonly
Array of lines in the tag annotation that are not changelog entries.
Instance Method Summary collapse
-
#initialize(tag) ⇒ Tag
constructor
Gets change information for a specific tagged version.
Constructor Details
#initialize(tag) ⇒ Tag
Gets change information for a specific tagged version.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/tag.rb', line 36 def initialize(tag) annotation = Git.get_tag_annotation(tag) @date = Date.parse(Git.get_tag_date(tag)) if annotation annotation = annotation.split("\n") @heading = annotation.shift @heading = @heading.split(' ')[1..-1].join(' ') if @heading filter = ChangelogFilter.FromArray(annotation) @text = filter.other_text.remove_indent if filter.other_text @changelog = filter.changelog end end |
Instance Attribute Details
#changelog ⇒ Object (readonly)
Array of lines in the tag annotation that are changelog entries.
27 28 29 |
# File 'lib/tag.rb', line 27 def changelog @changelog end |
#date ⇒ Object (readonly)
Author commit date of the tag
30 31 32 |
# File 'lib/tag.rb', line 30 def date @date end |
#heading ⇒ Object
The heading of the tag annotation.
21 22 23 |
# File 'lib/tag.rb', line 21 def heading @heading end |
#text ⇒ Object (readonly)
Array of lines in the tag annotation that are not changelog entries.
24 25 26 |
# File 'lib/tag.rb', line 24 def text @text end |