blob: 9238515b77dda728e9c93f41fba3ad08d7956658 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  | 
require 'formula'
class CssCrush < Formula
  homepage 'http://the-echoplex.net/csscrush'
  url 'https://github.com/peteboere/css-crush/archive/v2.1.0.tar.gz'
  sha1 '3285917dce69420e2822c59e5c25401aaaa5ea64'
  def install
    libexec.install Dir['*']
    (bin+'csscrush').write <<-EOS.undent
      #!/bin/sh
      php "#{libexec}/cli.php" "$@"
    EOS
  end
  test do
    path = testpath/"test.crush"
    path.write <<-EOS.undent
      @define foo #123456;
      p { color: $(foo); }
    EOS
    output = `#{bin}/csscrush #{path}`.strip
    assert_equal "p{color:#123456}", output
    assert_equal 0, $?.exitstatus
  end
end
  |