Sha256: 2fb31170537c2cba4a704805c7beac02eb934ee52c2a252789030dc1e387a97e

Contents?: true

Size: 510 Bytes

Versions: 9

Compression:

Stored size: 510 Bytes

Contents

# frozen_string_literal: true

require "gitt"
require "refinements/strings"
require "refinements/structs"

module Rubysmith
  module Configuration
    # Dynamically adds Git email if defined.
    module Enhancers
      using Refinements::Strings
      using Refinements::Structs

      GitEmail = lambda do |content, git: Gitt::Repository.new|
        return content unless String(content.author_email).blank?

        content.merge author_email: git.get("user.email").value_or("")
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubysmith-4.9.0 lib/rubysmith/configuration/enhancers/git_email.rb
rubysmith-4.8.0 lib/rubysmith/configuration/enhancers/git_email.rb
rubysmith-4.7.0 lib/rubysmith/configuration/enhancers/git_email.rb
rubysmith-4.6.1 lib/rubysmith/configuration/enhancers/git_email.rb
rubysmith-4.6.0 lib/rubysmith/configuration/enhancers/git_email.rb
rubysmith-4.5.0 lib/rubysmith/configuration/enhancers/git_email.rb
rubysmith-4.4.0 lib/rubysmith/configuration/enhancers/git_email.rb
rubysmith-4.3.0 lib/rubysmith/configuration/enhancers/git_email.rb
rubysmith-4.2.0 lib/rubysmith/configuration/enhancers/git_email.rb