Sha256: a93212c9a6f1ae3aa0a783636e9556dcbec313f356523247628216c93dc7ce8d

Contents?: true

Size: 985 Bytes

Versions: 4

Compression:

Stored size: 985 Bytes

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'optparse'

options = {}
OptionParser.new do |opts|
  opts.banner = <<BANNER
Optimize a single image or a whole folder in the cloud.

gif`s:
 - called with a folder gif`s will not be optimized
 - called on a singe .gif, it will be optimized if it is optimizeable

Usage:
    smusher /apps/x/public/images [options]
    smusher /apps/x/public/images/x.png [options]
    smusher /apps/x/public/images/*.png [options]

Options are:
BANNER
  opts.on("-q", "--quiet","no output") { options[:quiet]=true }
  opts.on("-c", "--convert-gifs","convert all .gif`s in the given folder") { options[:convert_gifs]=true }
  opts.on("-h", "--help","Show this.") { puts opts;exit }
end.parse!

path = ARGV.first
if path.to_s.empty? or not File.exist?(path)
  puts "Usage instructions: autotest --help"
  exit
end

require 'smusher'
if File.directory?(path)
  Smusher.optimize_images_in_folder(path,options)
else
  Smusher.optimize_image(ARGV,options)
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
grosser-smusher-0.3.6 bin/smusher
grosser-smusher-0.3.7 bin/smusher
grosser-smusher-0.3.8 bin/smusher
smusher-0.3.8 bin/smusher