Sha256: 0c24205c32140ae3714997120cdbe561de4630df8cf6f071122c41d3a8bda5bc

Contents?: true

Size: 572 Bytes

Versions: 3

Compression:

Stored size: 572 Bytes

Contents

module Cp8Cli
  class CurrentUser
    def current
      @_current ||= new
    end

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

    def trello_id
      trello_user.id
    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 ||= Github::Base.client.user
      end

      def trello_user
        @_trello_user ||= Trello::Member.current
      end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cp8_cli-6.0.1 lib/cp8_cli/current_user.rb
cp8_cli-6.0.0 lib/cp8_cli/current_user.rb
cp8_cli-5.0.0 lib/cp8_cli/current_user.rb