Class: Git::TagList
- Inherits:
-
Object
- Object
- Git::TagList
- Defined in:
- lib/tag_changelog/git/tag_list.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns an array of tag names surrounded by HEAD at the top and the sha1 of the first commit at the bottom.
Instance Method Summary collapse
-
#initialize(include_head = true) ⇒ TagList
constructor
Instantiates the tag list.
-
#latest_tag ⇒ String
Returns the most recent tag in the git repository, or the sha1 of the initial commit if there is no tag.
Constructor Details
#initialize(include_head = true) ⇒ TagList
Instantiates the tag list.
32 33 34 35 |
# File 'lib/tag_changelog/git/tag_list.rb', line 32 def initialize(include_head = true) @include_head = include_head @list = build_list end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns an array of tag names surrounded by HEAD at the top and the sha1 of the first commit at the bottom.
25 26 27 |
# File 'lib/tag_changelog/git/tag_list.rb', line 25 def list @list end |
Instance Method Details
#latest_tag ⇒ String
Returns the most recent tag in the git repository, or the sha1 of the initial commit if there is no tag.
42 43 44 45 46 |
# File 'lib/tag_changelog/git/tag_list.rb', line 42 def latest_tag # Index 0 is HEAD # Index 1 is most recent tag or first commit @list[1] end |