Sha256: cdf1d960cb94f76fa558797e278df04417895b8308e2260ddc102815ef4a1630

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require "milestoner"
require "refinements/structs"

module Rubysmith
  module Extensions
    # Ensures project can be published (tagged) in a reliable and consistent fashion.
    class Milestoner
      using Refinements::Structs

      def self.call(...) = new(...).call

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

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

      private

      attr_reader :configuration, :client, :content

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-2.0.2 lib/rubysmith/extensions/milestoner.rb
rubysmith-2.0.1 lib/rubysmith/extensions/milestoner.rb
rubysmith-2.0.0 lib/rubysmith/extensions/milestoner.rb
rubysmith-1.3.0 lib/rubysmith/extensions/milestoner.rb
rubysmith-1.2.0 lib/rubysmith/extensions/milestoner.rb
rubysmith-1.1.1 lib/rubysmith/extensions/milestoner.rb