Created
January 7, 2011 21:46
-
-
Save rjungemann/770165 to your computer and use it in GitHub Desktop.
Checks a directory structure for files missing newlines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'ptools' | |
| start = ARGV.first || '.' | |
| Dir.glob("#{start}/**/**").each do |f| | |
| begin | |
| next if(File.directory?(f) || File.binary?(f)) | |
| puts f unless File.read(f).split('')[-1] == "\n" | |
| rescue Exception => e | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment