2010-11-09 17:49:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Jsmin < Formula
|
2010-11-09 17:49:48 +00:00
|
|
|
homepage 'http://www.crockford.com/javascript/jsmin.html'
|
2013-08-02 15:50:18 +00:00
|
|
|
url 'https://github.com/douglascrockford/JSMin/archive/1bf6ce5f74a9f8752ac7f5d115b8d7ccb31cfe1b.tar.gz'
|
|
|
|
version '2013-03-29'
|
|
|
|
sha1 '8330fa182c283d5cc3fefcfb412bba662c0e2ee9'
|
2010-11-09 17:49:48 +00:00
|
|
|
|
|
|
|
def install
|
2013-08-02 15:50:18 +00:00
|
|
|
system ENV.cc, 'jsmin.c', '-o', 'jsmin'
|
2010-11-09 17:49:48 +00:00
|
|
|
bin.install 'jsmin'
|
|
|
|
end
|
2014-02-12 04:49:36 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
IO.popen("#{bin}/jsmin", "w+") do |pipe|
|
|
|
|
pipe.puts "var i = 0; // comment"
|
|
|
|
pipe.close_write
|
|
|
|
assert_equal "\nvar i=0;", pipe.read
|
|
|
|
end
|
|
|
|
end
|
2010-11-09 17:49:48 +00:00
|
|
|
end
|