News for hackers. Stuff that matters.
Re:Share Code Snippets With Ease by nmc on Tuesday February 04, 2014 @10:55AM (#7178189)
Ruby is not standard on Mac OS X. EDIT: actually it is, thanks the_french.

I would be happy to rewrite that in vanilla shell this evening.

Re:Share Code Snippets With Ease by the_french on Tuesday February 04, 2014 @10:59AM (#7178217)
IIRC ruby is in fact standard and was recently updated to be 2.0.0 on the latest version of OS X.

   /usr/bin/ruby -v
   ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
Re:Share Code Snippets With Ease by nmc on Tuesday February 04, 2014 @11:04AM (#7178250)
My bad! Completely forgot about that!

Considering that rvm and gems are a real pain in the azz, I think this could still benefit from a rewrite.

Re:Share Code Snippets With Ease by kbar13 on Tuesday February 04, 2014 @11:16AM (#7178323)
Use rbenv:

https://github.com/sstephenson/rbenv

Best decision I've made.

Re:Share Code Snippets With Ease by lnanek2 on Tuesday February 04, 2014 @11:26AM (#7178398)
That's a strange comment. OS X does indeed ship with Ruby. Maybe you are thinking about Rails? Or how developers often update it to a different version before using it? Mac OS X Mavericks includes Ruby 2.0.0p247.
Re:Share Code Snippets With Ease by lukabratos on Tuesday February 04, 2014 @10:57AM (#7178203)
That would be great!
Re:Share Code Snippets With Ease by nmc on Wednesday February 05, 2014 @07:16AM (#7183290)
In spite of the fact that Ruby is indeed standard on Mac OS X, a simple shell script would have been clearly lighter. However, for proper JSON escaping of the snippet, you need a full set of replacing rules, which kind of kills the purpose. So I give up.