Skip to content

Instantly share code, notes, and snippets.

@dv
Last active December 26, 2015 17:39
Show Gist options
  • Save dv/7188258 to your computer and use it in GitHub Desktop.
Save dv/7188258 to your computer and use it in GitHub Desktop.
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
@dv
Copy link
Author

dv commented Oct 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment