[Nitro] Source code cleanup

George Moschovitis george.moschovitis at gmail.com
Thu Oct 27 15:19:31 EDT 2005


Dear devs,

I am using the following script to cleanup the source code:


LF = "\x0a"

Dir['**/*'].each do |filename|
  unless File.directory?(filename) or filename =~ /\.db$/ or filename
=~ /\.bin$/ or filename =~ /gif$/ or filename =~ /png$/ or filename =~
/swf$/ or filename =~ /jpg$/ or filename =~ /darcs/
    puts "Converting #{filename}..."
    s = File.read(filename).gsub("\t", " "*2).gsub(/\r\n/, LF)
    File.open(filename, "wb") {|f| f << s}
  end
end

Can anyone propose some additional cleanup rules?

thanks,
George.

--
http://www.gmosx.com
http://www.navel.gr
http://www.nitrohq.com




More information about the Nitro-general mailing list