aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike McQuaid2012-07-22 13:39:35 +0100
committerMike McQuaid2012-07-22 14:05:42 +0100
commit414954213db3e14582644aa7e65657d2ac19f0a5 (patch)
tree0e1af2709e8aeaac0404791098b1d2d3a4b5d374 /Library/Formula
parent376b2a7635c3ad57d3d7d2e03a22adf9f011821c (diff)
downloadhomebrew-414954213db3e14582644aa7e65657d2ac19f0a5.tar.bz2
Add yuicompressor support to htmlcompressor.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/htmlcompressor.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Formula/htmlcompressor.rb b/Library/Formula/htmlcompressor.rb
index e90ed6496..f5691dd8e 100644
--- a/Library/Formula/htmlcompressor.rb
+++ b/Library/Formula/htmlcompressor.rb
@@ -5,11 +5,24 @@ class Htmlcompressor < Formula
homepage 'http://code.google.com/p/htmlcompressor/'
md5 '91575c89c83d0563dcf2aad409e4748f'
+ def options
+ [
+ ['--yuicompressor', "Use YUICompressor for JS/CSS compression."],
+ ]
+ end
+
+ depends_on "yuicompressor" if ARGV.include? '--yuicompressor'
+
def install
libexec.install "htmlcompressor-#{version}.jar"
(bin+'htmlcompressor').write <<-EOS.undent
#!/bin/sh
java -jar "#{libexec}/htmlcompressor-#{version}.jar" $@
EOS
+ if ARGV.include? '--yuicompressor'
+ yui = Formula.factory('yuicompressor')
+ yui_jar = "yuicompressor-#{yui.version}.jar"
+ ln_s "#{yui.libexec}/#{yui_jar}", "#{libexec}/#{yui_jar}"
+ end
end
end