Skip to content

Commit

Permalink
v5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed May 23, 2018
1 parent a0c3de3 commit 9c04757
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
34 changes: 17 additions & 17 deletions build/gist
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ end
module Gist
extend self

VERSION = '4.6.2'
VERSION = '5.0.0'

# A list of clipboard commands with copy and paste support.
CLIPBOARD_COMMANDS = {
Expand Down Expand Up @@ -1414,6 +1414,13 @@ module Gist
#
# @see http://developer.github.com/v3/gists/
def multi_gist(files, options={})
if options[:anonymous]
raise 'Anonymous gists are no longer supported. Please log in with `gist --login`. ' \
'(Github now requires credentials to gist https://bit.ly/2GBBxKw)'
else
access_token = (options[:access_token] || auth_token())
end

json = {}

json[:description] = options[:description] if options[:description]
Expand All @@ -1432,11 +1439,6 @@ module Gist
return if json[:files].empty? && options[:skip_empty]

existing_gist = options[:update].to_s.split("/").last
if options[:anonymous]
access_token = nil
else
access_token = (options[:access_token] || auth_token())
end

url = "#{base_path}/gists"
url << "/" << CGI.escape(existing_gist) if existing_gist.to_s != ''
Expand Down Expand Up @@ -1903,16 +1905,12 @@ specified STDIN will be read. The default filename for STDIN is "a.rb", and all
filenames can be overridden by repeating the "-f" flag. The most useful reason
to do this is to change the syntax highlighting.
If you'd like your gists to be associated with your GitHub account, so that you
can edit them and find them in future, first use `gist --login` to obtain an
Oauth2 access token. This is stored and used by gist in the future.
All gists must to be associated with a GitHub account, so you will need to login with
`gist --login` to obtain an Oauth2 access token. This is stored and used by gist in the future.
Private gists do not have guessable URLs and can be created with "-p", you can
also set the description at the top of the gist by passing "-d".
Anonymous gists are not associated with your GitHub account, they can be created
with "-a" even after you have used "gist --login".
If you would like to shorten the resulting gist URL, use the -s flag. This will
use GitHub's URL shortener, git.io. You can also use -R to get the link to the
raw gist.
Expand All @@ -1929,7 +1927,7 @@ original gist with the same GitHub account.
If you want to skip empty files, use the --skip-empty flag. If all files are
empty no gist will be created.
Usage: #{executable_name} [-o|-c|-e] [-p] [-s] [-R] [-d DESC] [-a] [-u URL]
Usage: #{executable_name} [-o|-c|-e] [-p] [-s] [-R] [-d DESC] [-u URL]
[--skip-empty] [-P] [-f NAME|-t EXT]* FILE*
#{executable_name} --login
#{executable_name} [-l|-r]
Expand Down Expand Up @@ -1971,10 +1969,6 @@ Usage: #{executable_name} [-o|-c|-e] [-p] [-s] [-R] [-d DESC] [-a] [-u URL]
options[:update] = update
end

opts.on("-a", "--anonymous", "Create an anonymous gist.") do
options[:anonymous] = true
end

opts.on("-c", "--copy", "Copy the resulting URL to the clipboard") do
options[:copy] = true
end
Expand Down Expand Up @@ -2027,6 +2021,12 @@ Usage: #{executable_name} [-o|-c|-e] [-p] [-s] [-R] [-d DESC] [-a] [-u URL]
end.parse!

begin
if Gist.auth_token.nil?
puts 'Please log in with `gist --login`. ' \
'(Github now requires credentials to gist https://bit.ly/2GBBxKw)'
exit(1)
end

options[:output] = if options[:embed] && options[:shorten]
raise Gist::Error, "--embed does not make sense with --shorten"
elsif options[:embed]
Expand Down
2 changes: 1 addition & 1 deletion build/gist.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIST" "1" "January 2018" "" "Gist manual"
.TH "GIST" "1" "May 2018" "" "Gist manual"
.
.SH "NAME"
\fBgist\fR \- upload code to https://gist\.github\.com
Expand Down
2 changes: 1 addition & 1 deletion lib/gist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
module Gist
extend self

VERSION = '4.6.2'
VERSION = '5.0.0'

# A list of clipboard commands with copy and paste support.
CLIPBOARD_COMMANDS = {
Expand Down

0 comments on commit 9c04757

Please sign in to comment.