File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,13 @@ def default_filename
108
108
#
109
109
# @see http://developer.github.com/v3/gists/
110
110
def multi_gist ( files , options = { } )
111
+ if options [ :anonymous ]
112
+ raise 'Anonymous gists are no longer supported. Please log in with `gist --login`. ' \
113
+ '(Github now requires credentials to gist https://bit.ly/2GBBxKw)'
114
+ else
115
+ access_token = ( options [ :access_token ] || auth_token ( ) )
116
+ end
117
+
111
118
json = { }
112
119
113
120
json [ :description ] = options [ :description ] if options [ :description ]
@@ -126,12 +133,6 @@ def multi_gist(files, options={})
126
133
return if json [ :files ] . empty? && options [ :skip_empty ]
127
134
128
135
existing_gist = options [ :update ] . to_s . split ( "/" ) . last
129
- if options [ :anonymous ]
130
- raise 'Anonymous gist support has been removed by Github. ' \
131
- 'See: https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/'
132
- else
133
- access_token = ( options [ :access_token ] || auth_token ( ) )
134
- end
135
136
136
137
url = "#{ base_path } /gists"
137
138
url << "/" << CGI . escape ( existing_gist ) if existing_gist . to_s != ''
Original file line number Diff line number Diff line change 10
10
end
11
11
12
12
it 'should raise an error when trying to do operations without being logged in' do
13
- error_msg = 'Anonymous gist support has been removed by Github . ' \
14
- 'See: https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/ '
13
+ error_msg = 'Anonymous gists are no longer supported. Please log in with `gist --login` . ' \
14
+ '(Github now requires credentials to gist https://bit.ly/2GBBxKw) '
15
15
16
16
expect do
17
17
Gist . gist ( "Test gist" , output : :raw_url , anonymous : true )
Original file line number Diff line number Diff line change 14
14
end
15
15
16
16
it 'should raise an error when trying to get short urls without being logged in' do
17
- error_msg = 'Anonymous gist support has been removed by Github . ' \
18
- 'See: https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/ '
17
+ error_msg = 'Anonymous gists are no longer supported. Please log in with `gist --login` . ' \
18
+ '(Github now requires credentials to gist https://bit.ly/2GBBxKw) '
19
19
20
20
expect do
21
21
Gist . gist ( "Test gist" , output : :short_url , anonymous : true )
You can’t perform that action at this time.
0 commit comments