pdfcpu 0.2.4 (new formula)
Closes #43417. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
parent
6c380bf4f0
commit
9024ba5448
1 changed files with 27 additions and 0 deletions
27
Formula/pdfcpu.rb
Normal file
27
Formula/pdfcpu.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
class Pdfcpu < Formula
|
||||
desc "PDF processor written in Go"
|
||||
homepage "https://pdfcpu.io"
|
||||
url "https://github.com/pdfcpu/pdfcpu/archive/v0.2.4.tar.gz"
|
||||
sha256 "939ad359bb363b9c559046664e81bea216fbdc2762c64a0ebc5c33422c415733"
|
||||
|
||||
depends_on "go" => :build
|
||||
|
||||
def install
|
||||
ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache"
|
||||
(buildpath/"src/github.com/pdfcpu/pdfcpu").install buildpath.children
|
||||
cd "src/github.com/pdfcpu/pdfcpu/cmd/pdfcpu" do
|
||||
system "go", "build", "-o", bin/"pdfcpu", "-ldflags",
|
||||
"-X github.com/pdfcpu/pdfcpu/pkg/pdfcpu.VersionStr=#{version}"
|
||||
end
|
||||
end
|
||||
|
||||
test do
|
||||
info_output = shell_output("#{bin}/pdfcpu info #{test_fixtures("test.pdf")}")
|
||||
assert_match "PDF version: 1.6", info_output
|
||||
assert_match "Page count: 1", info_output
|
||||
assert_match "Page size: 500.00 x 800.00 points", info_output
|
||||
assert_match "Encrypted: No", info_output
|
||||
assert_match "Permissions: Full access", info_output
|
||||
assert_match "validation ok", shell_output("#{bin}/pdfcpu validate #{test_fixtures("test.pdf")}")
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue