Created
July 25, 2014 22:14
-
-
Save davidbiehl/7eb97b0ade94d5d6076d to your computer and use it in GitHub Desktop.
Recursively Removes Carriage Returns from Ruby Files
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(File.join(%w(** *.rb))) do |filename| | |
buffer = File.open(filename, "r").read | |
File.open(filename, "w") do |output| | |
output.puts buffer.gsub(/\r\n/, "\n") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment