Current (3.1.0) no longer respects -t flag #88

Closed
ddd opened this Issue Mar 22, 2012 · 3 comments

Comments

Projects
None yet
4 participants

ddd commented Mar 22, 2012

Sent the following using the command:

cat mytest.sh | gist -t sh

and Type on gist.github.com was set as Text (https://gist.github.com/2164325)

Also tried with a ruby file. (https://gist.github.com/2164428)

This was bugging me, so I did a little digging. There are two issues happening that I can see.

  1. Gist#data does not account for the extension set on L106. This can be fixed by doing something like filename = "#{filename}#{file[:extension]}" if file[:extension] just under L203.
  2. It appears the Github API ignores extensions on filenames that begin with 'gistfile'. This simply requires changing 'gistfile' to something else on L203. This seems like a bug in the API though.

Making these changes in my own copy of gist seems to fix it. I can submit a PR with these fixes, but something tells me it's not quite this simple.

I notice this bug too, it's very annoying :P @itspriddle maybe make a pull request anyway and he can determine if it's sufficient? :)

goodell commented Apr 19, 2012

(subscribing to this thread)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment