[TxMt] ruby, markdown, shell, and environment question

Matt Neuburg matt at tidbits.com
Mon Jul 2 21:37:04 UTC 2007


I decided to write a modified version of a MultiMarkdown command, and
because I'm better at Ruby than I am at bash, I wrote my version of the
command in Ruby. It's working!

However, in order to pass the incoming text thru MultiMarkdown.pl, I open a
subprocess. I am not very savvy at subprocesses, so I have a couple of
questions:

(1) Is there an elegant way? Right now I'm using IO.popen, which has the
virtue that I understand what I'm doing, even though it's wordy.

(2) More important: we do not seem to be picking up the paths automatically,
so I have to construct (from ENV) a full path to where MultiMarkdown.pl sits
inside the support bundle. Is there a trick for handling this? The original
bash version just automagically "sees" MultiMarkdown.pl and SmartyPants.pl;
is there some way my Ruby script can automagically see them too?

Thx - m.

-- 
matt neuburg, phd = matt at tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>






More information about the textmate mailing list