Sha256: 5fa9347029efdc2060515a4863447bd8374c283fc8f6cb691b52fd61df6513d3
Contents?: true
Size: 683 Bytes
Versions: 18
Compression:
Stored size: 683 Bytes
Contents
# frozen_string_literal: true require "git_plus" require "refinements/strings" require "refinements/structs" module Rubysmith module Configuration module Enhancers # Dynamically adds Git email if defined. class GitEmail using Refinements::Strings using Refinements::Structs def initialize repository: GitPlus::Repository.new @repository = repository end def call content String(content.author_email).blank? ? content.merge(author_email: email) : content end private attr_reader :repository def email = repository.config_get("user.email") end end end end
Version data entries
18 entries across 18 versions & 1 rubygems