Last active
August 29, 2015 13:57
-
-
Save rap1ds/9830087 to your computer and use it in GitHub Desktop.
Remove all whitespaces from Rails project: Run the script in Rails console
This file contains 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
Dir.glob("app/**/*").select { |filename| ["rb", "js", "css", "scss", "erb", "haml", "yml"].include? filename.split(".").last }.each { |filename| | |
stripped = `git stripspace < #{filename}` | |
File.open(filename, 'w') { |file| file.write(stripped) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment