From: Mark Somerville Date: 2012-01-27T23:24:22+09:00 Subject: Re: Ruby bash replacement On Mon, Jan 23, 2012 at 12:27:19AM +0900, Rohit Mehta wrote: > Dear Rubyists, I have been inspired by the wonderful PERL shell known as > Zoidberg (https://metacpan.org/module/Zoidberg) to work on a Ruby UNIX > command shell. I do not think this has already been done yet. > > I imagine the ability to use basic commands like cd, ls, echo from Ruby and > also to use controls like >, |, etc. For sysadmins like me, I think this > might be a very useful tool! > > So I've started on this task twice without making much progress. My first > approach was to try pass ruby-bits to eval and program execution to popen. > My current thought is that it will be a lot easier to simply override the > class Irb. I'm not sure if this is a bad idea as my code might become tied > to a specific version of ruby/irb. > > I'm wondering if anyone else has thought about this problem and cares to > give me any advice/suggestions. If anyone is interested in collaboration, > we could use github. I'm the author of Urchin[1]. It aims to be be a Bash-like Unix shell with great interaction with Ruby. I actually really like interactive shells like Bash, but think that they start to suck once you need to do something of a certain complexity. At this point I want a really easy way to drop some Ruby in there. Lots of the basic shell stuff works - redirection, globbing, environment variables and job control - as well as very basic Ruby interaction. There are a number of cool things that could be added, but I ended up falling down a Readline rabbit hole (I spent a *lot* of time and effort fixing bugs in rb-readline and am now wondering if it might be easier and better to make the GNU Readline binding better). Unfortunately, various real-life things have taken over of late and it hasn't seen any work for a few months. I do aim to get back into it though... I'd love to hear any more thoughts and ideas you have! 1 - https://github.com/Spakman/urchin