Sha256: 05dfb5c82f396c2375691833dce4c1066d9332466443d7dc76012eee0db93ed3

Contents?: true

Size: 684 Bytes

Versions: 1

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"

module Milestoner
  module Configuration
    module Transformers
      module Generator
        # Conditionally updates generator version based on gem specification.
        class Version
          include Import[:specification]
          include Dry::Monads[:result]

          def initialize(key = :generator_version, **)
            super(**)
            @key = key
          end

          def call attributes
            attributes.fetch(key) { attributes.merge! key => specification.version }
            Success attributes
          end

          private

          attr_reader :key
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
milestoner-18.12.0 lib/milestoner/configuration/transformers/generator/version.rb