small ca_cert fixup and gist read support (-r) added back to lib/gist.rb #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
first issue:
when I clone gist it's non-functional out of the box
whitejs@eir:
/dev/git$ git clone https://github.com/defunkt/gist.git/dev/git$ cd gistCloning into gist...
remote: Counting objects: 672, done.
remote: Compressing objects: 100% (323/323), done.
remote: Total 672 (delta 366), reused 586 (delta 318)
Receiving objects: 100% (672/672), 968.35 KiB | 779 KiB/s, done.
Resolving deltas: 100% (366/366), done.
whitejs@eir:
whitejs@eir:~/dev/git/gist$ ls | ./gist -
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Usage: gist [options] [filename or stdin] [filename] ...
Filename '-' forces gist to read from stdin.
-p, --[no-]private Make the gist private
-t, --type [EXTENSION] Set syntax highlighting of the Gist by file extension
-o, --[no-]open Open gist in browser
-m, --man Print manual
-v, --version Print version
-h, --help Display this screen
by inserting " http.ca_file = FILE" on line 187 of gist (corresponds to 124 of lib/gist.rb and running 'rake') I get:
whitejs@eir:~/dev/git/gist$ ls | ./gist -
https://gist.github.com/931390
second issue
adding -r back
~ line 17:
GIST_URL_REGEXP = /https?://gist.github.com/\d+$/
added ~ line 107
read_mode = 0
gist
added ~ lines 130-132:
opts.on('-r', '--read', 'Read Gist') do
read_mode = 1
end
added lines
155-161:/^-/if read_mode == 1
ARGV.each do | gist_id_num |
next if gist_id_num =
Gist.read( gist_id_num )
end
exit
end
added lines ~ 212-215
def read(gist_id)
puts open(GIST_URL % gist_id).read unless gist_id.to_i.zero?
puts open(gist_id + '.txt').read if gist_id[GIST_URL_REGEXP]
end
so now:
whitejs@eir:
/dev/git/gist$ ls | gist -/dev/git/gist$ gist -r https://gist.github.com/931507https://gist.github.com/931507
whitejs@eir:
battle.png
bin
gist
gist.gemspec
lib
LICENSE
man
Rakefile
README.markdown