Skip to content

Conversation

fapestniegd
Copy link

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
Cloning 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:
/dev/git$ cd gist
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 -
https://gist.github.com/931507
whitejs@eir:
/dev/git/gist$ gist -r https://gist.github.com/931507
battle.png
bin
gist
gist.gemspec
lib
LICENSE
man
Rakefile
README.markdown

@indirect
Copy link
Collaborator

Gist is already assigning a CA file, here: https://github.com/defunkt/gist/blob/master/lib/gist.rb#L123

How is your patch different?

end
exit
end

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this code up inside the opts.on('-r') block unless there's a compelling reason not to.

@indirect
Copy link
Collaborator

Please resubmit with separate commits for separate functionality. Thanks!

@indirect indirect closed this Apr 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants