homebrew-core/Formula/excel-compare.rb

29 lines
1,013 B
Ruby
Raw Normal View History

class ExcelCompare < Formula
desc "Command-line tool (and API) for diffing Excel Workbooks"
homepage "https://github.com/na-ka-na/ExcelCompare"
2017-03-07 23:27:29 +00:00
url "https://github.com/na-ka-na/ExcelCompare/releases/download/0.6.1/ExcelCompare-0.6.1.zip"
sha256 "9da80954db03f23ebcb6571fdd24520a020a0ea05f46fbe4aba8e2af54c6048c"
2016-12-11 16:13:29 +00:00
bottle :unneeded
resource "sample_workbook" do
2017-03-07 23:27:29 +00:00
url "https://github.com/na-ka-na/ExcelCompare/raw/0.6.1/test/resources/ss1.xlsx", :using => :nounzip
sha256 "f362153aea24092e45a3d306a16a49e4faa19939f83cdcb703a215fe48cc196a"
end
def install
libexec.install Dir["bin/dist/*"]
(bin/"excel_cmp").write <<-EOS.undent
#!/bin/sh
java -ea -Xmx512m -cp "#{libexec}/*" com.ka.spreadsheet.diff.SpreadSheetDiffer "$@"
EOS
end
test do
resource("sample_workbook").stage testpath
assert_match %r{Excel files #{testpath}/ss1.xlsx and #{testpath}/ss1.xlsx match},
shell_output("#{bin}/excel_cmp #{testpath}/ss1.xlsx #{testpath}/ss1.xlsx")
end
end