homebrew-core/Formula/htmlcompressor.rb

27 lines
797 B
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Htmlcompressor < Formula
homepage 'http://code.google.com/p/htmlcompressor/'
2012-09-04 03:12:48 +00:00
url 'http://htmlcompressor.googlecode.com/files/htmlcompressor-1.5.3.jar'
sha1 '57db73b92499e018b2f2978f1c7aa7b1238c7a39'
2012-09-04 03:12:48 +00:00
option 'yuicompressor', "Use YUICompressor for JS/CSS compression"
2012-09-04 03:12:48 +00:00
depends_on "yuicompressor" => :optional if build.include? 'yuicompressor'
def install
libexec.install "htmlcompressor-#{version}.jar"
2012-09-04 03:12:48 +00:00
(bin+'htmlcompressor').write <<-EOS.undent
#!/bin/sh
2012-09-04 03:12:48 +00:00
java -jar "#{libexec}/htmlcompressor-#{version}.jar" "$@"
EOS
2012-09-04 03:12:48 +00:00
if build.include? 'yuicompressor'
yui = Formula.factory('yuicompressor')
yui_jar = "yuicompressor-#{yui.version}.jar"
ln_s "#{yui.libexec}/#{yui_jar}", "#{libexec}/#{yui_jar}"
end
end
end