Sha256: 6b1109de415e8a7cd5ddc83016d9114ed32f42205c4a60386f4922b90eef96b4

Contents?: true

Size: 541 Bytes

Versions: 3

Compression:

Stored size: 541 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?
      fail(Errors::Git, "Git tags could not be pushed to remote repository.") unless shell.system("git push --tags")
    end

    private

    attr_reader :git, :shell
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
milestoner-4.2.0 lib/milestoner/pusher.rb
milestoner-4.1.1 lib/milestoner/pusher.rb
milestoner-4.1.0 lib/milestoner/pusher.rb