Sha256: 351c4cf06a578f2e794a1513e0a843695ea70632d62ea2f7592326b3ac218fa6

Contents?: true

Size: 809 Bytes

Versions: 13

Compression:

Stored size: 809 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"
require "pathname"
require "runcom"

module Milestoner
  module Configuration
    module Transformers
      module Build
        # Ensures XDG configuration and gem template paths are configured.
        class TemplatePaths
          include Dry::Monads[:result]

          def initialize key = :build_template_paths,
                         default: Pathname(__dir__).join("../../../templates"),
                         xdg: Runcom::Config.new("milestoner/templates")
            @key = key
            @default = default
            @xdg = xdg
          end

          def call(attributes) = Success attributes.merge!(key => xdg.all.append(default))

          private

          attr_reader :key, :default, :xdg
        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/build/template_paths.rb
milestoner-18.10.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.9.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.8.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.7.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.6.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.5.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.4.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.3.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.2.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.1.0 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.0.1 lib/milestoner/configuration/transformers/build/template_paths.rb
milestoner-18.0.0 lib/milestoner/configuration/transformers/build/template_paths.rb