Class: GitCompound::Component::Version::VersionStrategy
- Inherits:
-
Object
- Object
- GitCompound::Component::Version::VersionStrategy
- 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
- #==(other) ⇒ Object
-
#initialize ⇒ VersionStrategy
constructor
A new instance of VersionStrategy.
-
#reachable? ⇒ Boolean
Should return true if this reference in source repository is reachable.
-
#ref ⇒ Object
Should return git reference (ex branch, tag or sha) This should not raise exception if unreachable.
-
#sha ⇒ Object
Should return sha for specified reference (ex tagged commit sha or head of specified branch).
-
#to_s ⇒ Object
String representation of this version strategy.
Constructor Details
#initialize ⇒ VersionStrategy
Returns a new instance of VersionStrategy.
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
29 30 31 |
# File 'lib/git_compound/component/version/version_strategy.rb', line 29 def reachable? raise NotImplementedError end |
#ref ⇒ Object
Should return git reference (ex branch, tag or sha) This should not raise exception if unreachable
15 16 17 |
# File 'lib/git_compound/component/version/version_strategy.rb', line 15 def ref raise NotImplementedError end |
#sha ⇒ Object
Should return sha for specified reference
(ex tagged commit sha or head of specified branch)
22 23 24 |
# File 'lib/git_compound/component/version/version_strategy.rb', line 22 def sha raise NotImplementedError end |
#to_s ⇒ Object
String representation of this version strategy
35 36 37 |
# File 'lib/git_compound/component/version/version_strategy.rb', line 35 def to_s raise NotImplementedError end |