Created
July 10, 2014 18:39
-
-
Save baldur/3ce36a1d5d066b97899b to your computer and use it in GitHub Desktop.
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
require 'find' | |
Find.find('.') do |path| | |
basename = File.basename(path) | |
dirname = File.dirname(path) | |
if dirname =~ /^\.\/src|^\.\/res/ | |
if basename =~ /.java$/ || basename =~ /.xml$/ | |
content = File.read(path) | |
if content =~ /\n\n$/ | |
File.write(path, content.gsub(/\n\n$/, "\n")) | |
puts dirname | |
puts basename | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment