Class: GitCompound::Component::Version::Tag

Inherits:
VersionStrategy show all
Defined in:
lib/git_compound/component/version/tag.rb

Overview

Component version as tag

Instance Method Summary collapse

Methods inherited from VersionStrategy

#==

Constructor Details

#initialize(repository, tag) ⇒ Tag

Returns a new instance of Tag.



7
8
9
10
# File 'lib/git_compound/component/version/tag.rb', line 7

def initialize(repository, tag)
  @repository = repository
  @tag        = tag
end

Instance Method Details

#reachable?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/git_compound/component/version/tag.rb', line 20

def reachable?
  @repository.tags.key?(@tag)
end

#refObject



12
13
14
# File 'lib/git_compound/component/version/tag.rb', line 12

def ref
  @tag
end

#shaObject



16
17
18
# File 'lib/git_compound/component/version/tag.rb', line 16

def sha
  @repository.tags[@tag]
end

#to_sObject



24
25
26
# File 'lib/git_compound/component/version/tag.rb', line 24

def to_s
  "tag: #{@tag}"
end