Created
December 23, 2010 18:20
-
-
Save wbailey/753345 to your computer and use it in GitHub Desktop.
A first pass at the github_user method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def github_user | |
return @github_user unless @github_user.to_s.empty? | |
@github_user = %x{git config --get github.user}.chomp | |
@github_user = ENV['USER'] if @github_user.empty? | |
raise Exception, 'Undefined github user' if @github_user.empty? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment