Module: GitFeats::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/git-feats/config.rb

Constant Summary collapse

CONFIG_USER_CMD =
"git config --global github.user"
CONFIG_KEY_CMD =
"git config --global feats.key"

Instance Method Summary collapse

Instance Method Details

#exists?Boolean

Check if config exists and is configured properly

Returns:

  • (Boolean)


20
21
22
# File 'lib/git-feats/config.rb', line 20

def exists?
  !name.empty? && !key.empty?
end

#keyObject

Returns the config value for api key



15
16
17
# File 'lib/git-feats/config.rb', line 15

def key
  @key ||= `#{CONFIG_KEY_CMD}`.chomp
end

#nameObject

Returns the config value for username



10
11
12
# File 'lib/git-feats/config.rb', line 10

def name
  @name ||= `#{CONFIG_USER_CMD}`.chomp
end