Sha256: b79dc27f369c5dab56b466dfefc8f9664fbd2714e6ea2f36871b458a05aed2c0

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

# frozen_string_literal: true

require "milestoner"

module Rubysmith
  module Extensions
    # Ensures project can be published (tagged) in a reliable and consistent fashion.
    class Milestoner
      def self.call(...) = new(...).call

      def initialize configuration,
                     client: ::Milestoner::Tags::Publisher.new,
                     content: ::Milestoner::Configuration::Content
        @configuration = configuration
        @client = client
        @content = content
      end

      def call = client.call(settings) && configuration

      private

      attr_reader :configuration, :client, :content

      def settings
        content[
          documentation_format: configuration.extensions_milestoner_documentation_format,
          prefixes: configuration.extensions_milestoner_prefixes,
          sign: configuration.extensions_milestoner_sign,
          version: configuration.project_version
        ]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubysmith-1.1.0 lib/rubysmith/extensions/milestoner.rb
rubysmith-1.0.0 lib/rubysmith/extensions/milestoner.rb