Sha256: 4e2ee4dcb8f51b095b4ab6c7af3b269557b277bb16a746c4977e839b9f2186a5
Contents?: true
Size: 510 Bytes
Versions: 5
Compression:
Stored size: 510 Bytes
Contents
# frozen_string_literal: true require "dry/monads" module Rubysmith module Configuration # Sets target root which defaults to current directory when key is missing. module Transformers include Dry::Monads[:result] TargetRoot = lambda do |content, path: Pathname.pwd| content.fetch(:target_root) { path } .then { |root| content.merge! target_root: root } .then { |updated_content| Dry::Monads::Success updated_content } end end end end
Version data entries
5 entries across 5 versions & 1 rubygems