@@ -1318,7 +1318,7 @@ end
1318
1318
module Gist
1319
1319
extend self
1320
1320
1321
- VERSION = '4.6.2 '
1321
+ VERSION = '5.0.0 '
1322
1322
1323
1323
# A list of clipboard commands with copy and paste support.
1324
1324
CLIPBOARD_COMMANDS = {
@@ -1414,6 +1414,13 @@ module Gist
1414
1414
#
1415
1415
# @see http://developer.github.com/v3/gists/
1416
1416
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
+
1417
1424
json = { }
1418
1425
1419
1426
json [ :description ] = options [ :description ] if options [ :description ]
@@ -1432,11 +1439,6 @@ module Gist
1432
1439
return if json [ :files ] . empty? && options [ :skip_empty ]
1433
1440
1434
1441
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
1440
1442
1441
1443
url = "#{ base_path } /gists"
1442
1444
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
1903
1905
filenames can be overridden by repeating the "-f" flag. The most useful reason
1904
1906
to do this is to change the syntax highlighting.
1905
1907
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.
1909
1910
1910
1911
Private gists do not have guessable URLs and can be created with "-p", you can
1911
1912
also set the description at the top of the gist by passing "-d".
1912
1913
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
-
1916
1914
If you would like to shorten the resulting gist URL, use the -s flag. This will
1917
1915
use GitHub's URL shortener, git.io. You can also use -R to get the link to the
1918
1916
raw gist.
@@ -1929,7 +1927,7 @@ original gist with the same GitHub account.
1929
1927
If you want to skip empty files, use the --skip-empty flag. If all files are
1930
1928
empty no gist will be created.
1931
1929
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]
1933
1931
[--skip-empty] [-P] [-f NAME|-t EXT]* FILE*
1934
1932
#{ executable_name } --login
1935
1933
#{ executable_name } [-l|-r]
@@ -1971,10 +1969,6 @@ Usage: #{executable_name} [-o|-c|-e] [-p] [-s] [-R] [-d DESC] [-a] [-u URL]
1971
1969
options [ :update ] = update
1972
1970
end
1973
1971
1974
- opts . on ( "-a" , "--anonymous" , "Create an anonymous gist." ) do
1975
- options [ :anonymous ] = true
1976
- end
1977
-
1978
1972
opts . on ( "-c" , "--copy" , "Copy the resulting URL to the clipboard" ) do
1979
1973
options [ :copy ] = true
1980
1974
end
@@ -2027,6 +2021,12 @@ Usage: #{executable_name} [-o|-c|-e] [-p] [-s] [-R] [-d DESC] [-a] [-u URL]
2027
2021
end . parse!
2028
2022
2029
2023
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
+
2030
2030
options [ :output ] = if options [ :embed ] && options [ :shorten ]
2031
2031
raise Gist ::Error , "--embed does not make sense with --shorten"
2032
2032
elsif options [ :embed ]
0 commit comments