Cool stuff Jan! Without realizing it I've been wanting this for a while now. Excellent idea =)
I like that it reuses the existing IRB session as well, smart.
- Joe
On Oct 3, 2008, at 10: 52AM, Jan Sabbe wrote:
Hi,
I made a command for the ruby texmate bundle that might be interesting.
What it does (on command-option-R):
- It takes the selected text or the current line (= STDIN)
- It finds a running IRB session in the Terminal.app. If you don't
have one, it starts a new one.
- It pastes your code in IRB and switches to the terminal.app.
It saves you from manually selecting, copying, switching and pasting to try out some code in irb. A poor man's SLIME if you will.
The command is a basic ruby script that uses the scripting bridge to drive Terminal.app. It can also be adopted to use other interactive consoles (python, clojure, ..) by changing the REPL_ constants at the top of the script.
- REPL_CMD is the command to start the interactive console
- REPL_PROCESS is the active process that ends up running in the
terminal.
- REPL_PROMPT is the prompt you get when you start the interactive
console
See attachment for the command.
Greetings,
Jan Sabbe <run_in_irb.patch.zip><Run in IRB.tmCommand.zip> _______________________________________________ textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate