Sha256: 434c4e39c7e7a04a641c53557dd24856681efef15da85679abaf2108754afdd7

Contents?: true

Size: 536 Bytes

Versions: 2

Compression:

Stored size: 536 Bytes

Contents

# frozen_string_literal: true

module Milestoner
  # Handles publishing of Git tags to remote repository.
  class Pusher
    def initialize git: Git.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

2 entries across 2 versions & 1 rubygems

Version Path
milestoner-4.0.0 lib/milestoner/pusher.rb
milestoner-3.0.0 lib/milestoner/pusher.rb