Skip to content

Commit 9c04757

Browse files
committed
v5.0.0
1 parent a0c3de3 commit 9c04757

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

build/gist

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ end
13181318
module Gist
13191319
extend self
13201320

1321-
VERSION = '4.6.2'
1321+
VERSION = '5.0.0'
13221322

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

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

14341441
existing_gist = options[:update].to_s.split("/").last
1435-
if options[:anonymous]
1436-
access_token = nil
1437-
else
1438-
access_token = (options[:access_token] || auth_token())
1439-
end
14401442

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

1974-
opts.on("-a", "--anonymous", "Create an anonymous gist.") do
1975-
options[:anonymous] = true
1976-
end
1977-
19781972
opts.on("-c", "--copy", "Copy the resulting URL to the clipboard") do
19791973
options[:copy] = true
19801974
end
@@ -2027,6 +2021,12 @@ Usage: #{executable_name} [-o|-c|-e] [-p] [-s] [-R] [-d DESC] [-a] [-u URL]
20272021
end.parse!
20282022

20292023
begin
2024+
if Gist.auth_token.nil?
2025+
puts 'Please log in with `gist --login`. ' \
2026+
'(Github now requires credentials to gist https://bit.ly/2GBBxKw)'
2027+
exit(1)
2028+
end
2029+
20302030
options[:output] = if options[:embed] && options[:shorten]
20312031
raise Gist::Error, "--embed does not make sense with --shorten"
20322032
elsif options[:embed]

build/gist.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" generated with Ronn/v0.7.3
22
.\" http://github.com/rtomayko/ronn/tree/0.7.3
33
.
4-
.TH "GIST" "1" "January 2018" "" "Gist manual"
4+
.TH "GIST" "1" "May 2018" "" "Gist manual"
55
.
66
.SH "NAME"
77
\fBgist\fR \- upload code to https://gist\.github\.com

lib/gist.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
module Gist
1313
extend self
1414

15-
VERSION = '4.6.2'
15+
VERSION = '5.0.0'
1616

1717
# A list of clipboard commands with copy and paste support.
1818
CLIPBOARD_COMMANDS = {

0 commit comments

Comments
 (0)