Thanks toJeremy Cron for contributing this example.
require "rest_client" task :minify do css_file = "public/stylesheets/main.css" css_min_file = "public/stylesheets/min/main.min.css" response = RestClient.post "https://www.toptal.com/developers/cssminifier/raw", {:input => File.open(css_file).read} File.open(css_min_file, "w").write(response) end
Click on the language of your choice to see an example: