2014-07-21 02:31:36 +00:00
|
|
|
require "formula"
|
2012-02-10 16:42:42 +00:00
|
|
|
|
|
|
|
class CssCrush < Formula
|
2014-07-21 02:31:36 +00:00
|
|
|
homepage "http://the-echoplex.net/csscrush"
|
|
|
|
url "https://github.com/peteboere/css-crush/archive/v2.2.1.tar.gz"
|
|
|
|
sha1 "39c721af2765f36d4a2990fe365fb18c3ee41485"
|
2012-02-10 16:42:42 +00:00
|
|
|
|
|
|
|
def install
|
2014-07-21 02:31:36 +00:00
|
|
|
libexec.install Dir["*"]
|
|
|
|
(bin+"csscrush").write <<-EOS.undent
|
2012-02-10 16:42:42 +00:00
|
|
|
#!/bin/sh
|
|
|
|
php "#{libexec}/cli.php" "$@"
|
|
|
|
EOS
|
|
|
|
end
|
2014-02-08 18:59:58 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
path = testpath/"test.crush"
|
|
|
|
path.write <<-EOS.undent
|
|
|
|
@define foo #123456;
|
|
|
|
p { color: $(foo); }
|
|
|
|
EOS
|
|
|
|
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "p{color:#123456}", shell_output("#{bin}/csscrush #{path}").strip
|
2014-02-08 18:59:58 +00:00
|
|
|
end
|
2012-02-10 16:42:42 +00:00
|
|
|
end
|