HTML Minifier Ruby Example
Check the example on how to use
Ruby
to minify a HTML hardcoded string and output to stdout:require "rest_client" response = RestClient.post "https://www.toptal.com/developers/html-minifier/api/raw", {:input => "<input type="text" />"} puts(response)
Install the
rest-client
gem, save the code to a file named minify.rb
and run the following command:ruby minify.rb
Output:
<input>