Home

Awesome

Ruby Shell Proxy

A ruby library to generate shell code for different shell implementations and platforms.

Rationale

RVM 1 was build using Bash/ZSH compatible code, it was working for a long time but shell scripting is quite complicated. Obviously it was working well only in Bash and ZSH, adapting more shells compatibility would require a more complex codding or dropping features.

As a result a plan was made to use of SMF for internal code and an library to translate pseudo code to different shells. At this time ruby was not considered as an implementation language because of the bootstrapping problem or as you could call it Chicken or the egg dilemma - how do you start ruby based tool for installing ruby.

But this changed thanks to three major factors, so first RVM got Binary Rubies introduced in RVM 1.16, second JRuby can be used as an fallback as it has an additional dependency of JVM - but which is also available for great number of platforms, last but not least DRUG attendees pointed out this possibility. With binary rubies it is possible to limit the bootstrapping script to just unpacking archive with proper ruby package for given platform.

Because changing shell environment requires using it's internally loaded code to be executed the new tool needs to allow generating shell code which then can be evaluated on any target shell and platform configuration. This is where ruby-shell-proxy comes into play to allow using Ruby DSL for writing shell code. It should allow testing the code without actually having access to all the target shells. It will also allow easy addition of more platforms as it's enough to describe the system in terms of command configuration and not to rewrite whole application for the new system.

Planned features