Coder Social home page Coder Social logo

jist's Introduction

The jist gem is deprecated and has been forked and improved to the gist gem. See defunkt/gist.

jist's People

Contributors

adamv avatar ainformatico avatar akahn avatar alistra avatar boucher avatar brtsz avatar cliffrowley avatar conradirwin avatar defunkt avatar dlo avatar ermaker avatar evmar avatar headius avatar indirect avatar jacknagel avatar jbarnette avatar jmelis avatar jrk avatar jzellman avatar keithpitt avatar kui avatar locks avatar loganj avatar luke-gru avatar mattn avatar pix avatar rking avatar rmanalan avatar wuputah avatar zph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jist's Issues

no README file in the gem

This makes it uncomfortable for packaging jist, especially because this repo does not use tags, so I have to fetch the README by commit or sync it locally.

Error: Got Net::HTTPInternalServerError from gist

First, I'd like to thank you for this, this is great. I'd been looking for an alternate to the gist by defunkt but currently it's broke. This looks real nice. However not all my scripts are able to be uploaded:

jist -p -d "Firefox settings restorer" -f ff-restore.sh ff-restore 
Error: Got Net::HTTPInternalServerError from gist:

Not sure the details but I think this has to do with the file itself somehow (or the characters in it?) as other scripts that I have definitely get uploaded. Even without options I get this too. Two scripts that I know have this are: ff-restore and pm. Any help in debugging let me know.

jist does not properly handle Ctl-c though it requests it for cancellation

∴ jist
(type a gist. <ctrl-c> to cancel, <ctrl-d> when done)
^C/Users/me/.rvm/gems/ruby-1.9.3-p194@dtf/gems/jist-0.7/bin/jist:83:in `read': Interrupt
        from /Users/me/.rvm/gems/ruby-1.9.3-p194@dtf/gems/jist-0.7/bin/jist:83:in `<top (required)>'
        from /Users/me/.rvm/gems/ruby-1.9.3-p194@dtf/bin/jist:23:in `load'
        from /Users/me/.rvm/gems/ruby-1.9.3-p194@dtf/bin/jist:23:in `<main>'

This is after hitting Control-C combination, as requested, for cancellation.

Reformat before gisting

Then finally (for now),

  opts.on("-r", "--reformat", "Process the input through vim's equalprg to reformat") do             
    options[:reformat] = true                                                       
  end

This one will be a super duper feature, though I suspect the implementation will cause you to wince.

The reason why I'm advocating vim for this is because it can do filetype detection for things with extensions or even for bare content (as long as it has a bangpath or a modeline), then people have already solved the reformatting problems.

It would be nice to take a one-liner then jist it to clean it up. Again, -N has a role in being a cool thing here.

Support binary files

I'm getting Error: invalid byte sequence in UTF-8 when jisting a PNG file (jist -d 'blah blah' file.png)

Subsume all Gist.vim functionality?

There are a couple in here we could use, all related to managing existing gists:

https://github.com/vim-scripts/Gist.vim

  • Delete the gist (you need to have opened the gist buffer first).
    Password authentication is needed.

      :Gist -d
    
  • Fork the gist (you need to have opened the gist buffer first).
    Password authentication is needed.

      :Gist -f
    
  • Star the gist (you need to have opened the gist buffer first).
    Password authentication is needed.

      :Gist +1
    
  • Unstar the gist (you need to have opened the gist buffer first).
    Password authentication is needed.

      :Gist -1
    
  • Get gist XXXXX and add to clipboard.

    :Gist -c XXXXX
    
  • List your public gists.

    :Gist -l
    
  • List gists from user "mattn".

    :Gist -l mattn
    
  • List everyone's gists.

    :Gist -la
    
  • List gists from your starred gists.

    :Gist -ls
    

File type selection without extension possible?

Is it possible to select the language without having to use the extension? I noticed by accident that I can do this by doing:

jist -p -d "example description" -f file.sh file

and then pushing it:

git init
git remote add reponame [email protected]:<number>.git
git add file
git commit -a -m "message"
git push --force reponame master

where file is the filename without the extension. and by doing this, I am able to get syntaxhighlighting without the extension example.

Because of this I was wondering if it was possible, or could this just be a loophole?

Bump short desc below English desc in -h output

If you have a low-$LINES window, this bit gets pushed up by the paragraphs:

Usage: jist [-o|-c] [-p] [-d DESC] [-t TOKEN|-a] [-u URL] [-P] [-f NAME]* FILE* 
   jist --login

I think if you leave the version line where it is, but move that line above the options breakdown, it'll be better balanced.

Launchy?

What about a dep on launchy for the -o flagcommand?

Failed (but present) pbcopy == ugly exception

There's on OS X with tmux running, pbcopy/pbpaste stop working, as a separate issue.

Regardless of that other breakage, when you're in tmux and echo sad | jist -c it fails with the bad error message:

Error: exception class/object expected

Edit before gisting

jist -e should jump you into something like ${VISUAL:-${EDITOR:-vim}} before it gists.

Maybe mention that vim can do :cq so you can abort the gist if you want. I'm not sure how other editors signal an abend, but I kind of don't care. ☺

Clipboard??

gist had clipboard.

This software is gawbij.

gist compatibility

I now have push access to the gist gem, and so we should replace gist by jist.

Talking with @indirect, changes that we want for this:

  • gist -p creates a private gist, jist -p contains a "public" gist.
    => we can probably leave this inconsistency (jist is default private, gist is default public, but it's wierd).
  • gist -t should set the file type, jist -t is the Oauth access token
    => we should use -t as an alternative to -f for STDIN; and maybe rename -t to -T (pretty sure no-one uses it)
  • gist has a man page, we should make one for jist.
  • jist should support filename = "-".

Join before gisting [Warning: Feature Creep]

opts.on("-j", "--join", "Replace newlines with a single space") do         
  options[:join] = true                                                       
end                                                                           

opts.on("-J", "--join-without-spaces", "Remove all newlines") do             
  options[:join_without_spaces] = true                                                       
end

Works well this:

opts.on("-N", "--no-gist", "Instead of uploading, replace the clipboard contents.") do             
  options[:no_gist] = true                                                       
end

…which makes -e take on a whole new life as: alias clipedit='jist -Ne'

And I know this is is not in keeping with a gem that "just gists".

But it's really a huge use case, IMO. I've used Clipboard.pm's clipedit and clipjoin countless times. Would be nice to get these features with a simple gem install jist + shell aliases.

At gem install, YARD spits errors

At gem installation, yard tries to build docs for it, and spits the following errors:


Building YARD (yri) index for jist-0.7...
[error]: Unhandled exception in YARD::Handlers::Ruby::MethodHandler:
[error]:   in `lib/jist.rb`:26:

    26: def gist(content, options={})

[error]: NoMethodError: undefined method `length' for nil:NilClass
[error]: Stack trace:
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:139:in `extract_types_and_name_from_text_unstripped'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:126:in `extract_types_and_name_from_text'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:76:in `parse_tag_with_types_name_and_default'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:88:in `parse_tag_with_options'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/library.rb:237:in `send_to_factory'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/library.rb:172:in `option_tag'

[error]: Unhandled exception in YARD::Handlers::Ruby::MethodHandler:
[error]:   in `lib/jist.rb`:45:

    45: def multi_gist(files, options={})

[error]: NoMethodError: undefined method `length' for nil:NilClass
[error]: Stack trace:
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:139:in `extract_types_and_name_from_text_unstripped'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:126:in `extract_types_and_name_from_text'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:76:in `parse_tag_with_types_name_and_default'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:88:in `parse_tag_with_options'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/library.rb:237:in `send_to_factory'
    /Users/jeffs/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yard-0.8.2.1/lib/yard/tags/library.rb:172:in `option_tag'

jist return http error

$ jist somescript.py 
/home/solstice/.gem/ruby/1.9.1/gems/jist-0.7.1/lib/jist.rb:71:in `multi_gist': Got Net::HTTPInternalServerError from gist:  (RuntimeError)
    from /home/solstice/.gem/ruby/1.9.1/gems/jist-0.7.1/bin/jist:91:in `<top (required)>'
    from /home/solstice/.gem/ruby/1.9.1/bin/jist:23:in `load'
    from /home/solstice/.gem/ruby/1.9.1/bin/jist:23:in `<main>'

It's the same error wether or not I have login in and get an oauth token.

Well I can't gist now neither so may be that's a server problem.

HTTP issue?

  • Attempt to
    jist script.pl
  • and received
    Error: Got Net::HTTPInternalServerError from gist:

Better browser launching

What about a soft dep (i.e., require only when needed + warn about need for installation) of launchy ?

The sensible-browser command is, AFAIK, a Debian deal, not a Linux deal

(That is, it's never worked for me (and I put off making ~/bin/sensible-browser because I wanted to fix this issue for others)

Added --copy_js option ... useful to others?

I forked the project to add a --copy_js option to jist. It modifies the url before copying to clipboard. The clipboard receives the 'Embed this gist' script tag rather than the plain gist url.

My use case is that I embed scripts on http://www.civet.ws using the 'Embed this jist' option in the web interface.

So, is this worth adding a test and sending a pull request?

Please let me know in this issue thread and if other people find it useful, then I'll add a test and submit a PR :D

can't update only meta-data

It would be useful to be able to update just the filename and/or description, e.g.

jist -u https://gist.github.com/ID -f new-file-name

Currently this requires some input on STDIN.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.