[LRUG] string_to_editor

Tom ten Thij mail at tomtenthij.nl
Fri Dec 11 03:11:44 PST 2009


Did you ever wish you could view a massive string in your text editor? I
often do when debugging (x|ht)tml. 'puts response.body' is often a bit
overwhelming.

Despair not, now you can:
$ gem install string_to_editor (make sure gemcutter is in your sources)
(rdb:1) require 'string_to_editor'
(rdb:1) response.body.view

What this does is write the string to a temporary file and run the editor
command in ENV['EDITOR'] on that file. Setting your favourite editor is best
done by adding a line to your ~/.bashrc. I recommend:
export EDITOR='emacsclient'

Happy holidays, Tom.

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Tom ten Thij
Unboxed Consulting, http://unboxedconsulting.com
T: +44 20 3137 2943 F: +44 20 7183 4251
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20091211/64618bdc/attachment-0003.html>


More information about the Chat mailing list