mameosx-commits Mailing List for A native Mac OS X port of MAME (Page 11)
Status: Beta
Brought to you by:
ddribin
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(32) |
Jul
(92) |
Aug
(47) |
Sep
|
Oct
(5) |
Nov
(2) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(19) |
Feb
|
Mar
|
Apr
(16) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: <dd...@us...> - 2007-06-21 14:22:40
|
Revision: 525 http://mameosx.svn.sourceforge.net/mameosx/?rev=525&view=rev Author: ddribin Date: 2007-06-21 07:22:35 -0700 (Thu, 21 Jun 2007) Log Message: ----------- Add tool to fix line endings Added Paths: ----------- mameosx/trunk/tools/fix_eol.rb Added: mameosx/trunk/tools/fix_eol.rb =================================================================== --- mameosx/trunk/tools/fix_eol.rb (rev 0) +++ mameosx/trunk/tools/fix_eol.rb 2007-06-21 14:22:35 UTC (rev 525) @@ -0,0 +1,54 @@ +#!/usr/bin/ruby + +require 'find' +require 'set' +require 'tempfile' + +$VERBOSE = true + +def fix_file(file) + $stderr.puts "Fixing #{file}" + Tempfile.open("temp") do |temp| + path = temp.path() + #temp.unlink + + File.open(file) do |f| + f.each do |line| + line.chomp! + temp.print "#{line}\n" + end + end + + File.rename(path, file) + end +end + +excludes = Set.new %w{ + bmp class dmg doc exe gif gz jar jpeg jpg m4p mov mp3 mpeg mpg + mv4 nib pdf png ppt psd rtf rtfd sit sitx tar tgz tif tiff wav xls zip +} + +# Return the part of the file name string after the last '.' +def file_type( file_name ) + File.extname( file_name ).gsub( /^\./, '' ).downcase +end + +Find.find(ARGV[0]) do |file| + extension = file_type(file) + should_exclude = excludes.include?(extension) + if FileTest.directory?(file) + if should_exclude + $stderr.puts "Pruning #{file}" + Find.prune + else + next + end + end + + if should_exclude + $stderr.puts "Skipping #{file}" + next + end + + fix_file(file) +end Property changes on: mameosx/trunk/tools/fix_eol.rb ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |