Sha256: 2ef7e8364b465a81a9c7157ce782091ebdd3c2e68242f464d5d8b1a0d7ecc364

Contents?: true

Size: 916 Bytes

Versions: 6

Compression:

Stored size: 916 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"

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

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

          def call content
            warn "`#{self.class}##{__method__}` is deprecated, use " \
                 "`Milestoner::Configuration::Transformers::Generator::Label` or " \
                 "`Milestoner::Configuration::Transformers::Generator::URI` instead.",
                 category: :deprecated

            Success({key => specification.labeled_version}.merge!(content))
          end

          private

          attr_reader :key
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
milestoner-17.6.0 lib/milestoner/configuration/transformers/project/generator.rb
milestoner-17.5.0 lib/milestoner/configuration/transformers/project/generator.rb
milestoner-17.4.0 lib/milestoner/configuration/transformers/project/generator.rb
milestoner-17.3.0 lib/milestoner/configuration/transformers/project/generator.rb
milestoner-17.2.0 lib/milestoner/configuration/transformers/project/generator.rb
milestoner-17.1.0 lib/milestoner/configuration/transformers/project/generator.rb