calvin-brand-light-mode
calvin-brand-dark-mode
∕
⌘K
About Calvin Podcast We Can Do This Book Speaking
aAbout Calvin
Podcast
wWe Can Do This Book
sSpeaking
Back

TextMate command: Invoke selection under OpenACS

Other
Calvin Correli·Mar 4, 2005· 1 minute
TextMate truly rocks. Just wrote another neat command in no time: Invoke in OpenACS.

One really great Rails feature that OpenACS lacks is the ability to run the interactive irb shell right inside the Rails environment, with all your models and helpers available, so you can poke around and try things out easily.

Well, now OpenACS has something that comes fairly close:

echo "proc textmate {} {" > $OACS_PAGEROOT/textmate.tcl
echo "$TM_SELECTED_TEXT" >> $OACS_PAGEROOT/textmate.tcl
echo "}" >> $OACS_PAGEROOT/textmate.tcl
echo "ns_return 200 text/html [textmate]" >> $OACS_PAGEROOT/textmate.tcl
curl -s $OACS_URL/textmate

UPDATE: Improved error-handling:

echo "proc textmate {} { " > $OACS_PAGEROOT/textmate.tcl
echo "$TM_SELECTED_TEXT" >> $OACS_PAGEROOT/textmate.tcl
echo "}" >> $OACS_PAGEROOT/textmate.tcl
echo "catch { set result [textmate] } result" >> $OACS_PAGEROOT/textmate.tcl
echo "ns_return 200 text/html \$result" >> $OACS_PAGEROOT/textmate.tcl
curl -s $OACS_URL/textmate
Previous Fax service recommendation
Next TextMate automation

Comments

Write a comment...
00:00 Recording...
calvin-brand-light-mode
calvin-brand-dark-mode
1 Chestnut Hill Plaza #1139
Newark, DE 19713
United States
Copyright © 2026 Calvin Correli
powered by