Class: Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/tag.rb

Overview

Represents a Git tag and its annotation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ Tag

Gets change information for a specific tagged version.

Parameters:

  • tag (String)

    Tag for which to instantiate the class.



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

#changelogObject (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

#dateObject (readonly)

Author commit date of the tag



30
31
32
# File 'lib/tag.rb', line 30

def date
  @date
end

#headingObject

The heading of the tag annotation.



21
22
23
# File 'lib/tag.rb', line 21

def heading
  @heading
end

#textObject (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