Friday, February 26, 2010

How to Pipe in Ruby

Today I asked this on StackOverflow and it turns out that "piping is hard" was the only interesting thing that was said to Ruby's detriment for command-line scripting. How hard can it be?
So after a bit of spelunking, I got this to work:

which is Ruby for

Of course, there are more ways to pipe, including concurrent and sequential, but since I haven't understood those yet, I think I'm okay to move forward for now (and leave those on the todo list).

No comments: