[Nitro] superflous spaces and random windows linefeeds in the source

Rob Pitt rob at motionpath.com
Wed Nov 2 10:02:10 EST 2005


A request to the devs, can we not have any windows linefeeds in nitro 
code? AFAIK they are unnecessary and when we edit files with macs, linux 
or bsd systems our text editors remove them when we change lines and 
cause a lot of problems trying to generate darcs patches. There are many 
powerful text editors for windows that do not require these spaces, my 
favorite being UltraEdit32. Here is a little script that will kill 
windows linefeeds and superflous spaces on the end of lines out of a file:

#!/usr/bin/env ruby
f=File.open(ARGV[0],"r")
new_lines = Array.new
begin
        f.readlines.each do |line|
                new_lines << line.gsub(/ +$/,"").delete(13.chr)
        end
ensure
        f.close
end
f=File.open(ARGV[0],"w")
f.write new_lines
f.close




More information about the Nitro-general mailing list