Skip to content

Instantly share code, notes, and snippets.

@wbailey
Created December 23, 2010 18:20
Show Gist options
  • Save wbailey/753345 to your computer and use it in GitHub Desktop.
Save wbailey/753345 to your computer and use it in GitHub Desktop.
A first pass at the github_user method
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