Skip to content

Commit dfc5325

Browse files
ujihisadefunkt
authored andcommitted
gist command didn't work at all without github.user config
1 parent 5e0a109 commit dfc5325

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

gist

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module Gist
7979
end
8080
end
8181
module Gist
82-
VERSION = Version = '1.2.0'
82+
VERSION = Version = '1.2.1'
8383
end
8484
require 'open-uri'
8585
require 'net/http'
@@ -218,7 +218,7 @@ private
218218
user = config("github.user")
219219
token = config("github.token")
220220

221-
user.empty? ? {} : { :login => user, :token => token }
221+
user.to_s.empty? ? {} : { :login => user, :token => token }
222222
end
223223

224224
def defaults
@@ -262,10 +262,10 @@ __END__
262262
.\" generated with Ronn/v0.5
263263
.\" http://github.com/rtomayko/ronn/
264264
.
265-
.TH "GIST" "1" "May 2010" "GITHUB" "Gist Manual"
265+
.TH "GIST" "1" "June 2010" "GITHUB" "Gist Manual"
266266
.
267267
.SH "NAME"
268-
\fBgist\fR \-\- gist on the command line
268+
\fBgist\fR \- gist on the command line
269269
.
270270
.SH "SYNOPSIS"
271271
\fBgist\fR [\fB\-p\fR] [\fB\-t extension\fR] \fIFILE\fR
@@ -301,6 +301,11 @@ Create a private gist instead of a public gist.
301301
Set the file extension explicitly. Passing a type of \fBrb\fR ensure
302302
the gist is created as a Ruby file.
303303
.
304+
.TP
305+
\fB\-o\fR, \fB\-\-[no\-]open\fR
306+
Open the gist in your browser after creation. Or don't. Defaults
307+
to \-\-open
308+
.
304309
.P
305310
You may additionally ask for help:
306311
.
@@ -312,7 +317,7 @@ Print help.
312317
\fB\-m\fR, \fB\-\-man\fR
313318
Display this man page.
314319
.
315-
.SH "CONFIGURATION"
320+
.SH "AUTHENTICATION"
316321
There are two ways to set GitHub user and token info:
317322
.
318323
.IP "\(bu" 4
@@ -358,16 +363,28 @@ $ git config \-\-global github.user <username>
358363
See \fIhttp://github.com/guides/local\-github\-config\fR for more
359364
information.
360365
.
361-
.P
362-
\fBgist\fR will check the \fBHTTP_PROXY\fR env variable if supplied:
366+
.SH "CONFIGURATION"
367+
You can set a few options in your git config (using git\-config(1)) to
368+
control the default behavior of gist(1).
363369
.
364-
.IP "" 4
370+
.IP "\(bu" 4
371+
gist.private \- boolean (yes or no) \- Determines whether to make a gist
372+
private by default
365373
.
366-
.nf
367-
368-
$ HTTP_PROXY=http://host:port/ gist script.py
374+
.IP "\(bu" 4
375+
gist.extension \- string \- Default extension for gists you create.
369376
.
370-
.fi
377+
.IP "\(bu" 4
378+
gist.browse \- boolean (yes or no) \- Whether to open the gist in your
379+
browser after creation. Default: yes
380+
.
381+
.IP "" 0
382+
.
383+
.SH "ENVIRONMENT"
384+
The following environment variables affect the execution of \fBgist\fR:
385+
.
386+
.IP "\(bu" 4
387+
HTTP_PROXY \- Proxy to use when Gisting. Should be "http://host:port/"
371388
.
372389
.IP "" 0
373390
.

lib/gist.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def auth
165165
user = config("github.user")
166166
token = config("github.token")
167167

168-
user.empty? ? {} : { :login => user, :token => token }
168+
user.to_s.empty? ? {} : { :login => user, :token => token }
169169
end
170170

171171
# Returns default values based on settings in your gitconfig. See

0 commit comments

Comments
 (0)