Skip to content

Commit a258bbc

Browse files
committed
update standalone
1 parent 881270e commit a258bbc

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

gist

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module Gist
7979
end
8080
end
8181
module Gist
82-
VERSION = Version = '1.4.1'
82+
VERSION = Version = '2.0.0'
8383
end
8484
require 'open-uri'
8585
require 'net/https'
@@ -182,7 +182,7 @@ module Gist
182182

183183
http.use_ssl = true
184184
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)
186186

187187
req = Net::HTTP::Post.new(url.path)
188188
req.form_data = data(files, private_gist)
@@ -276,7 +276,13 @@ private
276276
end
277277

278278
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
280286
end
281287
end
282288
Gist.execute(*ARGV)
@@ -337,7 +343,13 @@ There are two ways to set GitHub user and token info:
337343
Using env vars GITHUB_USER and GITHUB_TOKEN
338344
.
339345
.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
341353
.
342354
.IP "\(bu" 4
343355
Using git\-config(1)

0 commit comments

Comments
 (0)