Sha256: 6b2403603b15b40dc35be01fd43c5e6a77e97dd8c5bc6db439697a5ac467e647
Contents?: true
Size: 621 Bytes
Versions: 5
Compression:
Stored size: 621 Bytes
Contents
# frozen_string_literal: true require "dry/monads" require "pathname" require "refinements/hash" require "refinements/string" module Milestoner module Configuration module Transformers # Conditionally updates label based on current directory. module Project using Refinements::String using Refinements::Hash Label = lambda do |content, key = :project_label, default: Pathname.pwd.basename.to_s| content.fetch_value(key) { default.titleize } .then { |value| Dry::Monads::Success content.merge!(key => value) } end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems