Ruby detab: Difference between revisions

From EggeWiki
No edit summary
 
No edit summary
 
Line 1: Line 1:
Recently, at my work, a policy has been put into place that all files being checked in need to have a source control header and have spaces instead of tabs.  Since we have thousands of files which are out of compliance, I put together a small Ruby script to fix them.  I found the script rather useful, so I decided to share it with othersWell, not everyone liked my script as well as me.
I have put together a small Ruby script to add a source control headers, remove tabs, and fix line endings within source files.  I'm hosting it here under a GPL licenseSince I developed this software outside of work, but I intend to use it at work, I've included my team's standard headerFeel free to change this to reflect your organization.
 
I received an email stating my script had been deleted this morning.
<pre>
... #8 change 53775 delete on 2006/08/17 by tordoffy@tordoffy.unix (kxtext)
 
        Removed detab, as it is not in an approved language.
</pre>
 
To add insult to injury, I was worked until 12:30 AM last night, and returned to work at 7:30 AM this morning.  I was working late to fix a problem with a server in the London office.  Did the London office thank me for fixing their server last night?  No, they deleted my script while I was sleeping.
 
One might argue that it's normal for an organization to have approved languagesThat, I can understand.  However, this was a tool which I designed to save me time, and no one else is required to use it or maintain it.  It wouldn't even be so bad if we only had a few 'approved' languages.  If, I had written my script using one of these languages, I would have been fine:
 
<pre>
#!/usr/bin/ksh
#!/usr/bin/sh
#!/usr/lcoal/tcl/bin/destcl
#!/usr/local/bin/bash
#!/usr/local/bin/destcl
#!/usr/local/bin/expect
#!/usr/local/bin/gawk
#!/usr/local/bin/gmake
#!/usr/local/bin/gtcl
#!/usr/local/bin/gtwish
#!/usr/local/bin/perl
#!/usr/local/bin/python
#!/usr/local/bin/tclsh
#!/usr/local/bin/tcsh
#!/usr/local/bin/wish4.0
#!/usr/local/gnu/bin/bash
#!/usr/local/tcl-7.4/bin/destcl
#!/usr/local/tcl-7.4/bin/destk
#!/usr/local/tcl/bin/destcl
#!/usr/local/tcl/bin/destk
#!/usr/local/tcl/bin/tcl
#!/usr/local/tcl/bin/tcldes
#!/usr/local/tcl/bin/wishdes
</pre>


You can [{{SERVER}}/2006/detab.rb.html view] the source code to this script, or [{{SERVER}}/2006/detab.rb download] it.   
You can [{{SERVER}}/2006/detab.rb.html view] the source code to this script, or [{{SERVER}}/2006/detab.rb download] it.   


The html page was created with <code>vim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" detab.rb</code>
The html page was created with <code>vim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" detab.rb</code>

Latest revision as of 14:44, 22 August 2006

I have put together a small Ruby script to add a source control headers, remove tabs, and fix line endings within source files. I'm hosting it here under a GPL license. Since I developed this software outside of work, but I intend to use it at work, I've included my team's standard header. Feel free to change this to reflect your organization.

You can view the source code to this script, or download it.

The html page was created with vim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" detab.rb