<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - Ruby Code Beautifier Macro + Script - Comments</title>
 <link>http://community.activestate.com/forum-topic/ruby-code-beautifier-macro-script</link>
 <description>Comments for &quot;Ruby Code Beautifier Macro + Script&quot;</description>
 <language>en</language>
<item>
 <title>Right, there&#039;s a beginUndo... without a corresponding endUndo</title>
 <link>http://community.activestate.com/forum-topic/ruby-code-beautifier-macro-script#comment-5473</link>
 <description>&lt;p&gt;Try this mod:&lt;/p&gt;
&lt;div class=&quot;geshi-block&quot;&gt;
&lt;div class=&quot;geshifilter javascript&quot; style=&quot;font-family: monospace;&quot;&gt;ke.&lt;span style=&quot;color: #006600;&quot;&gt;beginUndoAction&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;try&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Run_RunEncodedCommand&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;window,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd + &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot; {&#039;insertOutput&#039;: True}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ke.&lt;span style=&quot;color: #006600;&quot;&gt;gotoPos&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;currentPos&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; komodo.&lt;span style=&quot;color: #006600;&quot;&gt;doCommand&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;cmd_cleanLineEndings&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;finally&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ke.&lt;span style=&quot;color: #006600;&quot;&gt;endUndoAction&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;geshi-plain&quot;&gt;ke.beginUndoAction();
        try {
            Run_RunEncodedCommand(window,
                                  cmd + &amp;quot; {&#039;insertOutput&#039;: True}&amp;quot;);
            ke.gotoPos(currentPos);
            komodo.doCommand(&#039;cmd_cleanLineEndings&#039;);
        } finally {
            ke.endUndoAction();
        }&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;- Eric&lt;/p&gt;
</description>
 <pubDate>Wed, 28 May 2008 18:11:11 +0100</pubDate>
 <dc:creator>ericp</dc:creator>
 <guid isPermaLink="false">comment 5473 at http://community.activestate.com</guid>
</item>
<item>
 <title>There&#039;s a bug in this macro,</title>
 <link>http://community.activestate.com/forum-topic/ruby-code-beautifier-macro-script#comment-5472</link>
 <description>&lt;p&gt;There&#039;s a bug in this macro, for some reason, after having used the beautifier, the undo action undoes all changes done to the file since the session initiated on that file. &lt;/p&gt;
&lt;p&gt;See &lt;a href=&quot;http://community.activestate.com/forum-topic/undo-undoes-all&quot; title=&quot;http://community.activestate.com/forum-topic/undo-undoes-all&quot;&gt;http://community.activestate.com/forum-topic/undo-undoes-all&lt;/a&gt;&lt;/p&gt;
</description>
 <pubDate>Wed, 28 May 2008 09:08:09 +0100</pubDate>
 <dc:creator>Naatan</dc:creator>
 <guid isPermaLink="false">comment 5472 at http://community.activestate.com</guid>
</item>
<item>
 <title>Another option for the underlying beautifier script</title>
 <link>http://community.activestate.com/forum-topic/ruby-code-beautifier-macro-script#comment-4379</link>
 <description>&lt;p&gt;I had a couple of spare hours in which I wrote my very own beautifier script for Ruby code. It should be considered pre alpha quality, but it works pretty well, especially if don&#039;t have the nasty habit to span statements over multiple lines;) It has a pretty clean OO design and is easily extensible with other functionality - for example it could fix spacing between operators apart from indentation. I have named the beautifier &quot;Code Red&quot; and have uploaded a version of it here. It consists of two parts - a CodeRed class that hosts the logic and a Ruby Formatter that does the actual work. Take a look at it if you are interested, I&#039;d be happy to hear some opinions.&lt;/p&gt;
</description>
 <pubDate>Sat, 01 Mar 2008 21:42:30 +0000</pubDate>
 <dc:creator>Lord_Bad</dc:creator>
 <guid isPermaLink="false">comment 4379 at http://community.activestate.com</guid>
</item>
<item>
 <title>Arachnoid Ruby Beautifier License</title>
 <link>http://community.activestate.com/forum-topic/ruby-code-beautifier-macro-script#comment-4206</link>
 <description>&lt;p&gt;Hey, that&#039;s cool, thank you!  &lt;/p&gt;
&lt;p&gt;So people know, you can find the original Arachnoid Ruby Beautifier at &lt;a href=&quot;http://www.arachnoid.com/ruby/rubyBeautifier.html&quot; title=&quot;http://www.arachnoid.com/ruby/rubyBeautifier.html&quot;&gt;http://www.arachnoid.com/ruby/rubyBeautifier.html&lt;/a&gt;&lt;br /&gt;
It is licensed under GPL.&lt;/p&gt;
</description>
 <pubDate>Fri, 15 Feb 2008 21:18:28 +0000</pubDate>
 <dc:creator>shanec</dc:creator>
 <guid isPermaLink="false">comment 4206 at http://community.activestate.com</guid>
</item>
<item>
 <title>Ruby Code Beautifier Macro + Script</title>
 <link>http://community.activestate.com/forum-topic/ruby-code-beautifier-macro-script</link>
 <description>&lt;p&gt;Inspired by Jeff&#039;s PHP beautifier I decided to provide something similar for Ruby developers.&lt;/p&gt;
&lt;p&gt;So I packaged together a modified version of Jeff&#039;s macro with a modified version of arachnoid&#039;s Ruby beautifier. The beautifier is pretty basic, but it handles indentation of Ruby code very well. It is aware of your indentation settings in Komodo, so as long as you&#039;re using tabs over spaces for indentation it will work perfectly for you. If I have the time I may further enhance it to handle more than just indentation.&lt;/p&gt;
&lt;p&gt;Here is the macro portion of the beautifier:&lt;/p&gt;
&lt;div class=&quot;geshi-block&quot;&gt;
&lt;div class=&quot;geshifilter javascript&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;try&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;komodo.&lt;span style=&quot;color: #006600;&quot;&gt;view&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;scintilla&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; komodo.&lt;span style=&quot;color: #006600;&quot;&gt;view&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;scintilla&lt;/span&gt;.&lt;span style=&quot;color: #000066;&quot;&gt;focus&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;komodo.&lt;span style=&quot;color: #006600;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;language&lt;/span&gt; == &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;Ruby&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; ke = komodo.&lt;span style=&quot;color: #006600;&quot;&gt;editor&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; currentPos = ke.&lt;span style=&quot;color: #006600;&quot;&gt;currentPos&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; indent = ke.&lt;span style=&quot;color: #006600;&quot;&gt;indent&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; file = komodo.&lt;span style=&quot;color: #006600;&quot;&gt;interpolate&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;%F&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; ruby = komodo.&lt;span style=&quot;color: #006600;&quot;&gt;interpolate&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;%(ruby)&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; script = &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;/home/bozhidar/rbeautify.rb&amp;quot;&lt;/span&gt;;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; cmd = ruby + &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt; + script + &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt; + file + &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt; + indent;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; StatusBar_AddMessage&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;Beautifying &amp;quot;&lt;/span&gt; + file + &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;...&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;editor&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;5000&lt;/span&gt;, &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; komodo.&lt;span style=&quot;color: #006600;&quot;&gt;doCommand&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;cmd_save&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ke.&lt;span style=&quot;color: #006600;&quot;&gt;beginUndoAction&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; komodo.&lt;span style=&quot;color: #006600;&quot;&gt;doCommand&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;cmd_selectAll&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Run_RunEncodedCommand&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;window, cmd + &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot; {&#039;insertOutput&#039;: True}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ke.&lt;span style=&quot;color: #006600;&quot;&gt;gotoPos&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;currentPos&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; komodo.&lt;span style=&quot;color: #006600;&quot;&gt;doCommand&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;cmd_cleanLineEndings&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; StatusBar_AddMessage&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;Finished beautification&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;editor&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #CC0000;&quot;&gt;5000&lt;/span&gt;, &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000066;&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;Not a Ruby file!&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000066;&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;geshi-plain&quot;&gt;try {
    if (komodo.view.scintilla) {
        komodo.view.scintilla.focus();
    }
    
    if (komodo.document.language == &amp;quot;Ruby&amp;quot;) {
        var ke = komodo.editor;
        
        var currentPos = ke.currentPos;
        var indent = ke.indent;
        
        var file = komodo.interpolate(&#039;%F&#039;);
        var ruby = komodo.interpolate(&#039;%(ruby)&#039;);
        var script = &amp;quot;/home/bozhidar/rbeautify.rb&amp;quot;;        
        
        var cmd = ruby + &amp;quot; &amp;quot; + script + &amp;quot; &amp;quot; + file + &amp;quot; &amp;quot; + indent;
        
        StatusBar_AddMessage(&amp;quot;Beautifying &amp;quot; + file + &amp;quot;...&amp;quot;,
                             &amp;quot;editor&amp;quot;, 5000, true);
       
        komodo.doCommand(&#039;cmd_save&#039;);
        ke.beginUndoAction();
        komodo.doCommand(&#039;cmd_selectAll&#039;);
        Run_RunEncodedCommand(window, cmd + &amp;quot; {&#039;insertOutput&#039;: True}&amp;quot;);
        ke.gotoPos(currentPos);
        komodo.doCommand(&#039;cmd_cleanLineEndings&#039;);
        StatusBar_AddMessage(&amp;quot;Finished beautification&amp;quot;, &amp;quot;editor&amp;quot;, 5000, true);
    } else {
        alert(&amp;quot;Not a Ruby file!&amp;quot;);
    }
} catch(e) {
    alert(e);
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can simply cut and paste this code and name the newly created macros Rbeautify for example.&lt;/p&gt;
&lt;p&gt;You have to change the line&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;var script = &quot;/home/bozhidar/rbeautify.rb&quot;;&lt;/pre&gt;&lt;p&gt;to the path to rbeautify.rb on your system.&lt;/p&gt;
&lt;p&gt;rbeautify.rb is packaged together with Rbeautify.kpz(which you can directly import in Komodo) in the attached to this topic file Rbeautify.zip.&lt;/p&gt;
&lt;p&gt;I hope you find the beautifier helpful. If you have any suggestions or problems, please let me know.&lt;/p&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/ruby-code-beautifier-macro-script#comments</comments>
 <category domain="http://community.activestate.com/forums/komodo-extensions-0">Komodo Macros and Extensions</category>
 <category domain="http://community.activestate.com/os/all-any">All / Any</category>
 <enclosure url="http://community.activestate.com/files/Rbeautify.zip" length="2797" type="application/zip" />
 <pubDate>Fri, 15 Feb 2008 14:20:08 +0000</pubDate>
 <dc:creator>Lord_Bad</dc:creator>
 <guid isPermaLink="false">1931 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
