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

Allan Odgaard throw-away-1 at macromates.com
Sat Jul 7 08:42:49 UTC 2007


On 2. Jul 2007, at 23:37, Matt Neuburg wrote:

> [...]
> (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.

How is this wordy? Maybe show the full code because popen() is meant  
for running a shell command with its input/output connected to the  
calling process and has little syntactic overhead.

> (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?

Commands in TM w/o shebang gets the TM_SUPPORT_DIR/lib/bash_init.sh  
file sourced, which sets up the path. For she-bang scripts, they have  
to do it themselves. Presently only “trick” is to not use shebang,  
instead using a here-doc, -e, call a script in the bundle from bash  
-- but personally I am not too fond of that “trick” (long-term there  
will be a unified PATH for shebang/non-shebang scripts).




More information about the textmate mailing list