Class: GitCompound::Component::Version::VersionStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/git_compound/component/version/version_strategy.rb

Overview

Abstraction for component versions like

gem version, sha and branch

Direct Known Subclasses

Branch, GemVersion, SHA, Tag

Instance Method Summary collapse

Constructor Details

#initializeVersionStrategy

Returns a new instance of VersionStrategy.

Raises:

  • (NotImplementedError)


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

def initialize
  raise NotImplementedError
end

Instance Method Details

#==(other) ⇒ Object



39
40
41
# File 'lib/git_compound/component/version/version_strategy.rb', line 39

def ==(other)
  sha == other.sha
end

#reachable?Boolean

Should return true if this reference in source repository

is reachable

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/git_compound/component/version/version_strategy.rb', line 29

def reachable?
  raise NotImplementedError
end

#refObject

Should return git reference (ex branch, tag or sha) This should not raise exception if unreachable

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/git_compound/component/version/version_strategy.rb', line 15

def ref
  raise NotImplementedError
end

#shaObject

Should return sha for specified reference

(ex tagged commit sha or head of specified branch)

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/git_compound/component/version/version_strategy.rb', line 22

def sha
  raise NotImplementedError
end

#to_sObject

String representation of this version strategy

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/git_compound/component/version/version_strategy.rb', line 35

def to_s
  raise NotImplementedError
end