Sha256: 62f47462b9f189df22315f1bd1b5c9abab74edefb7adeeda28a99d86290272c6

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

module GitCompound
  class Component
    module Version
      # Abstraction for component versions like
      #   gem version, sha and branch
      #
      class VersionStrategy
        def initialize
          raise NotImplementedError
        end

        # Should return git reference (ex branch, tag or sha)
        # This should not raise exception if unreachable
        #
        def ref
          raise NotImplementedError
        end

        # Should return sha for specified reference
        #   (ex tagged commit sha or head of specified branch)
        #
        def sha
          raise NotImplementedError
        end

        # Should return true if this reference in source repository
        #   is reachable
        #
        def reachable?
          raise NotImplementedError
        end

        # String representation of this version strategy
        #
        def to_s
          raise NotImplementedError
        end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
git_compound-0.2.2 lib/git_compound/component/version/version_strategy.rb
git_compound-0.2.1 lib/git_compound/component/version/version_strategy.rb
git_compound-0.2.0 lib/git_compound/component/version/version_strategy.rb