Class: GTA::TagFinder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ TagFinder

Returns a new instance of TagFinder.



5
6
7
# File 'lib/gta/tag_finder.rb', line 5

def initialize(tag)
  @tag = tag
end

Instance Attribute Details

#tagObject (readonly)

Returns the value of attribute tag.



3
4
5
# File 'lib/gta/tag_finder.rb', line 3

def tag
  @tag
end

Instance Method Details

#newestObject



9
10
11
12
# File 'lib/gta/tag_finder.rb', line 9

def newest
  return unless tag
  tags.last
end

#tag_listObject



14
15
16
# File 'lib/gta/tag_finder.rb', line 14

def tag_list
  `git tag -l #{tag}`
end

#tagsObject



18
19
20
# File 'lib/gta/tag_finder.rb', line 18

def tags
  tag_list.split(/\s/)
end