aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorDominyk Tiller2015-01-30 14:55:45 +0000
committerMike McQuaid2015-02-24 08:53:35 +0000
commite41921439d0357633095b985315435ee4b48a473 (patch)
treec0c3ae02320e45e45bcdded6d44aae4c87842163 /Library/Formula
parentbdeb758d7885c0027a660aebbdba2fe899fef258 (diff)
downloadhomebrew-e41921439d0357633095b985315435ee4b48a473.tar.bz2
pdf-redact-tools 0.1 (new formula)
Despite the 0.1 release tag this release is stable and the project is widely used and >1 year old. I requested the tagged release so I could work on a formula here, as it'd be good to get it in Homebrew. Strips metadata from PDFs, amongst other things. Highly useful. Closes #37127. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/pdf-redact-tools.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/Library/Formula/pdf-redact-tools.rb b/Library/Formula/pdf-redact-tools.rb
new file mode 100644
index 000000000..bc901bc46
--- /dev/null
+++ b/Library/Formula/pdf-redact-tools.rb
@@ -0,0 +1,30 @@
+class PdfRedactTools < Formula
+ homepage "https://github.com/micahflee/pdf-redact-tools"
+ url "https://github.com/micahflee/pdf-redact-tools/archive/v0.1.tar.gz"
+ sha256 "9d5f095e5d056eb527c08c4736b45c99aa6399424dd6ed7155e3d7cd1600c55e"
+ head "https://github.com/micahflee/pdf-redact-tools.git"
+
+ depends_on :python if MacOS.version <= :snow_leopard
+ depends_on "imagemagick"
+ depends_on "exiftool"
+ depends_on "ghostscript"
+
+ def install
+ ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
+ system "python", *Language::Python.setup_install_args(libexec)
+
+ bin.install Dir["#{libexec}/bin/*"]
+ bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
+ end
+
+ test do
+ # Modifies the file in the directory the file is placed in.
+ cp test_fixtures("test.pdf"), "test.pdf"
+ system bin/"pdf-redact-tools", "-e", "test.pdf"
+ assert File.exist?("test_pages/page-0.png")
+ rm_rf "test_pages"
+
+ system bin/"pdf-redact-tools", "-s", "test.pdf"
+ assert File.exist?("test-final.pdf")
+ end
+end