Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created January 5, 2010 21:42
Show Gist options
  • Save dchelimsky/269761 to your computer and use it in GitHub Desktop.
Save dchelimsky/269761 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
result = ""
STDIN.read.each do |line|
line.sub!(/(\s+)$/, "\n")
result << line
end
result.sub!(/(\n+)$/m, "\n")
puts result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment