Sha256: 8b0df6312d636ad97310a464b9e6437dd142e4681f7f7ed59772d8339ce27c74

Contents?: true

Size: 472 Bytes

Versions: 1

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"

module Rubysmith
  module Configuration
    module Transformers
      # Dynamically adds GitHub user if user is defined.
      class GitHubUser
        include Import[:git]
        include Dry::Monads[:result]

        def call content
          return Success content if content[:git_hub_user]

          git.get("github.user").fmap { |user| content.merge! git_hub_user: user }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubysmith-5.1.0 lib/rubysmith/configuration/transformers/git_hub_user.rb