TextMate command: Invoke selection under OpenACS
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
About Calvin Correli
I've spent the last 17 years learning, growing, healing, and discovering who I truly am, so that I'm now living every day aligned with my life's purpose.
0 comments
Leave a comment