Sha256: 3b6242ef96f0e4e2002571f317484296a5d2fcb4650f1225ae8f69797a26efa8

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

# frozen_string_literal: true

module Milestoner
  # Handles publishing of Git tags to remote repository.
  class Pusher
    def initialize git: Git::Kit.new, shell: Kernel
      @git = git
      @shell = shell
    end

    def push
      fail(Errors::Git) unless git.supported?
      fail(Errors::Git, "Git remote repository not configured.") unless git.remote?

      return if shell.system("git push --tags")

      fail(Errors::Git, "Git tags could not be pushed to remote repository.")
    end

    private

    attr_reader :git, :shell
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
milestoner-5.0.0 lib/milestoner/pusher.rb