Sha256: b347615d1569702ef33e344447be062f312fd261f7d01b72b2db3783ec3bfb60

Contents?: true

Size: 677 Bytes

Versions: 13

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"

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

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

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

          private

          attr_reader :key
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
milestoner-18.11.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.10.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.9.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.8.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.7.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.6.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.5.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.4.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.3.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.2.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.1.0 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.0.1 lib/milestoner/configuration/transformers/generator/uri.rb
milestoner-18.0.0 lib/milestoner/configuration/transformers/generator/uri.rb