Sha256: 8e052b6eee139d0d61a8f4073d43df28b4f537cb54c3973e1e6b4f7cb9f982ba

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"

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

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

          def call attributes
            attributes.fetch(key) { attributes.merge! key => specification.label }
            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/label.rb