Class: Milestoner::Configuration::Transformers::Build::TemplatePaths

Inherits:
Object
  • Object
show all
Defined in:
lib/milestoner/configuration/transformers/build/template_paths.rb

Overview

Ensures XDG configuration and gem template paths are configured.

Instance Method Summary collapse

Constructor Details

#initialize(key = :build_template_paths, default: Pathname(__dir__).join("../../../templates"), xdg: Runcom::Config.new("milestoner/templates")) ⇒ TemplatePaths

Returns a new instance of TemplatePaths.



15
16
17
18
19
20
21
# File 'lib/milestoner/configuration/transformers/build/template_paths.rb', line 15

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

Instance Method Details

#call(attributes) ⇒ Object



23
# File 'lib/milestoner/configuration/transformers/build/template_paths.rb', line 23

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