aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/htmlcleaner.rb
blob: 5e784361161afb7fce14c0abc080f554a81e2115 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'formula'

class Htmlcleaner < Formula
  homepage 'http://htmlcleaner.sourceforge.net/index.php'
  url 'https://downloads.sourceforge.net/project/htmlcleaner/htmlcleaner/htmlcleaner%20v2.8/htmlcleaner-2.8.zip'
  sha1 'e4cbfebb306fc0baa95205ba91e452c961eebf85'

  def install
    libexec.install "htmlcleaner-#{version}.jar"
    bin.write_jar_script libexec/"htmlcleaner-#{version}.jar", "htmlcleaner"
  end

  test do
    path = testpath/"index.html"
    path.write "<html>"

    output = `#{bin}/htmlcleaner src=#{path}`
    assert output.include?("</html>")
    assert_equal 0, $?.exitstatus
  end
end