Sha256: 04e76f3540a40d38422e2c154a4084f7142d5649657b0c40e1f33104c3b2015a

Contents?: true

Size: 514 Bytes

Versions: 7

Compression:

Stored size: 514 Bytes

Contents

# frozen_string_literal: true

module Milestoner
  # Handles the tagging and pushing of a milestone to a remote repository.
  class Publisher
    def initialize tagger: Tagger.new, pusher: Pusher.new
      @tagger = tagger
      @pusher = pusher
    end

    def publish version, sign: false
      tagger.create version, sign: sign
      pusher.push
    rescue Errors::Git => error
      tagger.delete version
      raise error.class, error.message
    end

    private

    attr_reader :tagger, :pusher
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
milestoner-5.0.0 lib/milestoner/publisher.rb
milestoner-4.2.0 lib/milestoner/publisher.rb
milestoner-4.1.1 lib/milestoner/publisher.rb
milestoner-4.1.0 lib/milestoner/publisher.rb
milestoner-4.0.0 lib/milestoner/publisher.rb
milestoner-3.0.0 lib/milestoner/publisher.rb
milestoner-2.2.0 lib/milestoner/publisher.rb