2015-09-20 20:52:57 +00:00
|
|
|
class Cdiff < Formula
|
|
|
|
desc "View colored diff with side by side and auto pager support"
|
|
|
|
homepage "https://github.com/ymattw/cdiff"
|
2016-01-21 21:28:23 +00:00
|
|
|
url "https://github.com/ymattw/cdiff/archive/0.9.8.tar.gz"
|
|
|
|
sha256 "676f025b385c40bdf784aabf8381b2006f5e3befc2768c4d454a276f759221f1"
|
2015-09-20 20:52:57 +00:00
|
|
|
head "https://github.com/ymattw/cdiff.git"
|
|
|
|
|
|
|
|
bottle :unneeded
|
|
|
|
|
2015-12-29 18:51:28 +00:00
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
|
|
|
|
2016-09-24 15:45:48 +00:00
|
|
|
conflicts_with "colordiff", :because => "both install `cdiff` binaries"
|
2016-08-23 00:22:51 +00:00
|
|
|
|
2015-09-20 20:52:57 +00:00
|
|
|
def install
|
2015-12-29 18:51:28 +00:00
|
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
|
|
|
|
system "python", *Language::Python.setup_install_args(libexec)
|
|
|
|
bin.install Dir[libexec/"bin/*"]
|
2016-09-24 15:45:48 +00:00
|
|
|
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
|
2015-09-20 20:52:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-12-29 18:51:28 +00:00
|
|
|
diff_fixture = test_fixtures("test.diff").read
|
|
|
|
assert_equal diff_fixture,
|
|
|
|
pipe_output("#{bin}/cdiff -cnever", diff_fixture)
|
2015-09-20 20:52:57 +00:00
|
|
|
end
|
|
|
|
end
|