Class: Verto::TagRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/verto/repositories/tag_repository.rb

Instance Method Summary collapse

Instance Method Details

#all(filter: nil) ⇒ Object



20
21
22
23
24
# File 'lib/verto/repositories/tag_repository.rb', line 20

def all(filter: nil)
  results = executor.run("git tag | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+(-.+\.[0-9]+)*' | sed 's/\([0-9]\.[0-9]\.[0-9]$\)/\1-zzzzzzzzzz/' | sort -V |  sed 's/-zzzzzzzzzz//' | cat").output.split

  filter ?  results.select { |tag| tag.match?(filter) } : results
end

#any?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/verto/repositories/tag_repository.rb', line 16

def any?
  all.any?
end

#create!(tag) ⇒ Object



11
12
13
14
# File 'lib/verto/repositories/tag_repository.rb', line 11

def create!(tag)
  # TODO: Implements tag in other commits
  executor.run! "git tag #{tag}"
end

#latest(filter: nil) ⇒ Object



7
8
9
# File 'lib/verto/repositories/tag_repository.rb', line 7

def latest(filter: nil)
  all(filter: filter).last
end