Last active
December 26, 2015 17:39
-
-
Save dv/7188258 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PngQuantProcessor < ::Tilt::Template | |
def prepare | |
# noop | |
end | |
def evaluate(scope, locals, &block) | |
IO.popen("pngquant -", "rb+") do |process| | |
process.write(data) | |
process.close_write | |
process.read | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also https://gist.github.com/dv/7188341