Skip to content

Instantly share code, notes, and snippets.

@davidbiehl
Created July 25, 2014 22:14
Show Gist options
  • Save davidbiehl/7eb97b0ade94d5d6076d to your computer and use it in GitHub Desktop.
Save davidbiehl/7eb97b0ade94d5d6076d to your computer and use it in GitHub Desktop.
Recursively Removes Carriage Returns from Ruby Files
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