gem install html_compressor
require 'html_compressor' compressor = HtmlCompressor::HtmlCompressor.new compressor.compress(<<-END_HTML) <html> <head> </head> <body> fdgdfgf </body> </html> END_HTML
Output “<html><head></head><body>fdgdfgf</body></html>”