Skip to content

Instantly share code, notes, and snippets.

@maxlinc
Created March 12, 2014 21:04
Show Gist options
  • Select an option

  • Save maxlinc/9516309 to your computer and use it in GitHub Desktop.

Select an option

Save maxlinc/9516309 to your computer and use it in GitHub Desktop.
Check for trailing blank lines
Dir['**/*.rb'].each do |f|
begin
puts f unless File.read(f) =~ /^$\Z/
rescue => e
$stderr.puts "Couldn't read #{f}: #{e.message}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment