Sha256: 0ed324bb74c2d2a0a2d26ff9d5ccc84065f650b5fea156b39be7baa236bc6413

Contents?: true

Size: 1001 Bytes

Versions: 7

Compression:

Stored size: 1001 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"
require "milestoner"

module Gemsmith
  module Tools
    # Versions (tags) current project (local and remote).
    class Versioner
      include Import[:configuration]
      include Dry::Monads[:result]

      def initialize(
        client: Milestoner::Tags::Publisher.new,
        content: Milestoner::Configuration::Content,
        **
      )
        super(**)
        @client = client
        @content = content
      end

      def call specification
        client.call settings(specification)
        Success specification
      rescue Milestoner::Error => error
        Failure error.message
      end

      private

      attr_reader :client, :content

      def settings specification
        content[
          documentation_format: configuration.extensions_milestoner_documentation_format,
          prefixes: configuration.extensions_milestoner_prefixes,
          version: specification.version
        ]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gemsmith-19.8.0 lib/gemsmith/tools/versioner.rb
gemsmith-19.7.0 lib/gemsmith/tools/versioner.rb
gemsmith-19.6.0 lib/gemsmith/tools/versioner.rb
gemsmith-19.5.2 lib/gemsmith/tools/versioner.rb
gemsmith-19.5.1 lib/gemsmith/tools/versioner.rb
gemsmith-19.5.0 lib/gemsmith/tools/versioner.rb
gemsmith-19.4.0 lib/gemsmith/tools/versioner.rb