2010-11-29 10:11:09 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Htmlcompressor < Formula
|
2011-10-24 13:22:02 +00:00
|
|
|
url 'http://htmlcompressor.googlecode.com/files/htmlcompressor-1.5.2.jar'
|
2010-11-29 10:11:09 +00:00
|
|
|
homepage 'http://code.google.com/p/htmlcompressor/'
|
2011-10-24 13:22:02 +00:00
|
|
|
md5 '91575c89c83d0563dcf2aad409e4748f'
|
2010-11-29 10:11:09 +00:00
|
|
|
|
2012-07-22 12:39:35 +00:00
|
|
|
def options
|
|
|
|
[
|
|
|
|
['--yuicompressor', "Use YUICompressor for JS/CSS compression."],
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
depends_on "yuicompressor" if ARGV.include? '--yuicompressor'
|
|
|
|
|
2010-11-29 10:11:09 +00:00
|
|
|
def install
|
2012-07-22 12:39:07 +00:00
|
|
|
libexec.install "htmlcompressor-#{version}.jar"
|
2010-11-29 10:11:09 +00:00
|
|
|
(bin+'htmlcompressor').write <<-EOS.undent
|
|
|
|
#!/bin/sh
|
2012-07-22 12:39:07 +00:00
|
|
|
java -jar "#{libexec}/htmlcompressor-#{version}.jar" $@
|
2010-11-29 10:11:09 +00:00
|
|
|
EOS
|
2012-07-22 12:39:35 +00:00
|
|
|
if ARGV.include? '--yuicompressor'
|
|
|
|
yui = Formula.factory('yuicompressor')
|
|
|
|
yui_jar = "yuicompressor-#{yui.version}.jar"
|
|
|
|
ln_s "#{yui.libexec}/#{yui_jar}", "#{libexec}/#{yui_jar}"
|
|
|
|
end
|
2010-11-29 10:11:09 +00:00
|
|
|
end
|
|
|
|
end
|