/usr/bin/sf is in ruby-sprite-factory 1.7.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/usr/bin/ruby
$LOAD_PATH.push File.expand_path("../lib", File.dirname(__FILE__)) # add sprite factory library to load path
require 'sprite_factory'
require 'optparse'
options = { :report => true }
op = OptionParser.new
op.banner = "#{SpriteFactory::DESCRIPTION}\nUsage: sprite <dir> [options]"
op.on("-h", "--help") do
puts op.to_s
exit
end
op.on("-v", "--version") do
puts SpriteFactory::VERSION
exit
end
layout_help = "specify layout orientation ( horizontal, vertical, packed )"
style_help = "specify stylesheet syntax ( css, scss, sass )"
library_help = "specify image library to use ( rmagic, chunkypng )"
selector_help = "specify custom selector to use for each css rule ( default: 'img.' )"
cssurl_help = "specify custom string to use for css image urls ( default: 'url(output image basename)' )"
output_image_help = "specify output location for generated image ( default: <input folder>.png )"
output_style_help = "specify output location for generated stylesheet ( default: <input folder>.<style>)"
pngcrush_help = "use pngcrush to optimize generated image"
padding_help = "add padding to each sprite"
margin_help = "add margin to each sprite"
glob_help = "specify glob pattern used to find images ( default: '*' )"
nocomments_help = "suppress comments in generated stylesheet"
sanitizer_help = "strip non-word characters out of filenames when converting to css selector"
op.on("--layout [ORIENTATION]", layout_help) {|value| options[:layout] = value }
op.on("--style [STYLE]", style_help) {|value| options[:style] = value }
op.on("--library [LIBRARY]", library_help) {|value| options[:library] = value }
op.on("--selector [SELECTOR]", selector_help) {|value| options[:selector] = value }
op.on("--cssurl [CSSURL]", cssurl_help) {|value| options[:cssurl] = value }
op.on("--output-image [PATH]", output_image_help) {|value| options[:output_image] = value }
op.on("--output-style [PATH]", output_style_help) {|value| options[:output_style] = value }
op.on("--pngcrush", pngcrush_help) {|value| options[:pngcrush] = value }
op.on("--padding [PIXELS]", padding_help) {|value| options[:padding] = value.to_i }
op.on("--margin [PIXELS]", margin_help) {|value| options[:margin] = value.to_i }
op.on("--glob [PATTERN]", glob_help) {|value| options[:glob] = value }
op.on("--nocomments", nocomments_help) {|value| options[:nocomments] = true }
op.on("--sanitizer", sanitizer_help) {|value| options[:sanitizer] = true }
begin
op.parse!(ARGV)
raise "a single argument must be specified containing images to be sprited" if ARGV.empty?
SpriteFactory.run!(ARGV[0], options)
rescue Exception => ex
puts ex.message
exit
end
|