Class: Gemsmith::Kit

Inherits:
Object
  • Object
show all
Defined in:
lib/gemsmith/kit.rb

Overview

Provides supplementary utility methods.

Class Method Summary collapse

Class Method Details

.git_config_value(key) ⇒ Object

Answers the git config (i.e. ~/.gitconfig) value for a given key, otherwise nil.

Parameters

# * key - Required. The git config key to search for.



7
8
9
10
# File 'lib/gemsmith/kit.rb', line 7

def self.git_config_value key
  value = `git config #{key}`.chomp
  value.nil? || value.empty? ? nil : value
end