# ANN: InstantERB

**URL:** <https://www.ruby-forum.com/t/ann-instanterb/90266>\
**Category:** Ruby\
**Created:** [March 27, 2007, 5:56am UTC](https://www.ruby-forum.com/t/ann-instanterb/90266 "2007-03-27T05:56:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![giaco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a3d4f5/32.png) [@giaco](https://www.ruby-forum.com/u/giaco)\
**Post date:** [March 27, 2007, 5:56am UTC](https://www.ruby-forum.com/t/ann-instanterb/90266/1 "2007-03-27T05:56:40Z")

</div>

Inspired by Florian G.'s Execute as Ruby Code Service for OS X  
([Execute as Ruby Code Service for OS X - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/102680)), I have created InstantERB. It  
uses the incredibly useful AutoHotKey utility. It will run any selected  
text through ERB.

For example, selecting the following block of text and hitting  
+I:

The value of pi is approximately \<%= Math::PI %\>.

% 3.times do |i|  
\<%= i %\>  
% end

will yield:

The value of pi is approximately 3.14159265358979.

0  
1  
2

Installation instructions:  
Install AutoHotKey ([http://www.autohotkey.com/](http://www.autohotkey.com/))  
Download [http://www.jackchristensen.com/file\_download/InstantERB.ahk](http://www.jackchristensen.com/file_download/InstantERB.ahk)

You can either run InstantERB.ahk directly or copy and paste it into  
your own AutoHotKey file.

Jack C.
