File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ module Gist
79
79
end
80
80
end
81
81
module Gist
82
- VERSION = Version = '1.4.1 '
82
+ VERSION = Version = '2.0.0 '
83
83
end
84
84
require 'open-uri'
85
85
require 'net/https'
@@ -182,7 +182,7 @@ module Gist
182
182
183
183
http . use_ssl = true
184
184
http . verify_mode = OpenSSL ::SSL ::VERIFY_PEER
185
- http . ca_file = File . join ( File . dirname ( __FILE__ ) , "cacert.pem" )
185
+ http . cert = OpenSSL :: X509 :: Certificate . new ( ca_cert )
186
186
187
187
req = Net ::HTTP ::Post . new ( url . path )
188
188
req . form_data = data ( files , private_gist )
@@ -276,7 +276,13 @@ private
276
276
end
277
277
278
278
def ca_cert
279
- DATA . read . split ( "__CACERT__" ) . last
279
+ cert_path = File . join ( File . dirname ( __FILE__ ) , "gist" , "cacert.pem" )
280
+
281
+ if File . exists? cert_path
282
+ File . read ( cert_path )
283
+ else
284
+ DATA . read . split ( "__CACERT__" ) . last
285
+ end
280
286
end
281
287
end
282
288
Gist . execute ( *ARGV )
@@ -337,7 +343,13 @@ There are two ways to set GitHub user and token info:
337
343
Using env vars GITHUB_USER and GITHUB_TOKEN
338
344
.
339
345
.IP
340
- $ export GITHUB_USER=johndoe $ export GITHUB_TOKEN=mysecretgithubtoken $ gist ~/example
346
+ $ export GITHUB_USER=johndoe
347
+ .
348
+ .br
349
+ $ export GITHUB_TOKEN=mysecretgithubtoken
350
+ .
351
+ .br
352
+ $ gist ~/example
341
353
.
342
354
.IP "\(bu" 4
343
355
Using git\-config(1)
You can’t perform that action at this time.
0 commit comments