Skip to content

Instantly share code, notes, and snippets.

@jeroenvisser101
Created May 6, 2016 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroenvisser101/8fe83792ea92c8cd4b55edf705f57c97 to your computer and use it in GitHub Desktop.
Save jeroenvisser101/8fe83792ea92c8cd4b55edf705f57c97 to your computer and use it in GitHub Desktop.
Simple image optimisation in image_optim
# lib/tasks/assets.rake
require 'image_optim'
require 'image_optim/runner'
namespace :assets do
desc 'Runs image_optim on the assets.'
task :optimize do
image_optim = ImageOptim::Runner.new(recursive: true)
image_optim.run!(Dir['app/**/*.{svg,jpg,png,jpeg,gif}'])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment