Sha256: 8cfe0beb9ed7470c16aea1066cbd454a9e0d939dcae29267c54a73ddbcaeb886

Contents?: true

Size: 1003 Bytes

Versions: 10

Compression:

Stored size: 1003 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"
require "milestoner"

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

      def initialize(
        publisher: Milestoner::Tags::Publisher.new,
        model: Milestoner::Configuration::Model,
        **
      )
        super(**)
        @publisher = publisher
        @model = model
      end

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

      private

      attr_reader :publisher, :model

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gemsmith-20.7.0 lib/gemsmith/tools/versioner.rb
gemsmith-20.6.1 lib/gemsmith/tools/versioner.rb
gemsmith-20.6.0 lib/gemsmith/tools/versioner.rb
gemsmith-20.5.0 lib/gemsmith/tools/versioner.rb
gemsmith-20.4.0 lib/gemsmith/tools/versioner.rb
gemsmith-20.3.0 lib/gemsmith/tools/versioner.rb
gemsmith-20.2.1 lib/gemsmith/tools/versioner.rb
gemsmith-20.2.0 lib/gemsmith/tools/versioner.rb
gemsmith-20.1.0 lib/gemsmith/tools/versioner.rb
gemsmith-20.0.0 lib/gemsmith/tools/versioner.rb