RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

apeiros — 3 posts

http://apeiros.me

fork gem released  rubygems.org
I released the fork gem, which provides a simple and object oriented interface to forking of your process.
The API provides ways to get the return value of a fork, get exceptions raised and send objects between the parent and a fork.
The project is - of course - found on github, and the documentation is available online.
I released the directory_template gem, which allows you to generate directory structures from a template, optionally processing paths
(variables in the path) and contents (e.g., render ERB templates).
You can write and use your own processors too (for both, path and content manipulation).
This is useful if you want to template e.g. Projects, or want to build something akin to rails' generators.
The project is - of course - found on github, and the documentation is available online.
Due to a series of questions on how to dynamically define local variables (which is an anti-pattern, mind you, you almost certainly should use a Hash instead), I went ahead and implemented Kernel#extract and Kernel#compact.
Ruby being OO, those pseudo-functions would probably be better implemented as methods (e.g. Binding#extract), but that's left as an exercise for the reader ;-)