I'm wondering if there's an existent solution to the following problem:
I have the following code:
<div>
<div>
<div><%= {:something => 'abc',
:else => 'abc',
:nice => 'ok'} %>
</div>
</div>
</div>
As you can see it's unested and hard to read. I was wondering if there's an existent tool preferably in ruby which could reindent the document (no modifications or validations to the source). Just reindent.
The expected result would be:
<div>
<div>
<div>
<%= {:something => 'abc',
:else => 'abc',
:nice => 'ok'} %>
</div>
</div>
</div>
Also, on a side not I want to implement this as a command on Textmate.