homebrew-core/Formula/yuicompressor.rb
CNA-Bld 11e6837e56 yuicompressor: modernize, https, sha256
Closes Homebrew/homebrew#37560.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-03-10 15:34:05 +00:00

22 lines
704 B
Ruby

class Yuicompressor < Formula
homepage "https://yui.github.io/yuicompressor/"
url "https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.zip"
sha256 "3243fd79cb68cc61a5278a8ff67a0ad6a2d825c36464594b66900ad8426a6a6e"
def install
libexec.install "yuicompressor-#{version}.jar"
bin.write_jar_script libexec/"yuicompressor-#{version}.jar", "yuicompressor"
end
test do
path = testpath/"test.js"
path.write <<-EOS
var i = 1; // foo
console.log(i); // bar
EOS
output = `#{bin}/yuicompressor --nomunge --preserve-semi #{path}`.strip
assert_equal "var i=1;console.log(i);", output
assert_equal 0, $?.exitstatus
end
end