Sha256: 8310c44df90be364fc75fa591adc35a81c09e74587cbebd3e7b29c8e2fc7e59c

Contents?: true

Size: 455 Bytes

Versions: 5

Compression:

Stored size: 455 Bytes

Contents

require "active_support/core_ext/string"

module Cp8Cli
  class CurrentUser
    include Github::Api::Client

    def initials
      git_user_name.parameterize(separator: " ").split.map(&:first).join
    end

    def github_login
      github_user.login
    end

    private

      def git_user_name
        @_git_user_name ||= Command.read("git config user.name")
      end

      def github_user
        @_github_user ||= client.user
      end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cp8_cli-8.2.1 lib/cp8_cli/current_user.rb
cp8_cli-8.2.0 lib/cp8_cli/current_user.rb
cp8_cli-8.1.0 lib/cp8_cli/current_user.rb
cp8_cli-8.0.1 lib/cp8_cli/current_user.rb
cp8_cli-8.0.0 lib/cp8_cli/current_user.rb