From 16dce1a70c881871830275ae6d9bf6c9883944cc Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Thu, 8 Jan 2015 13:49:31 +0800 Subject: [PATCH] dnscrypt-proxy: modernize and add test --- Formula/dnscrypt-proxy.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Formula/dnscrypt-proxy.rb b/Formula/dnscrypt-proxy.rb index e33647a22e..7a08b80235 100644 --- a/Formula/dnscrypt-proxy.rb +++ b/Formula/dnscrypt-proxy.rb @@ -1,5 +1,3 @@ -require "formula" - class DnscryptProxy < Formula homepage "http://dnscrypt.org" url "https://github.com/jedisct1/dnscrypt-proxy/releases/download/1.4.2/dnscrypt-proxy-1.4.2.tar.bz2" @@ -20,7 +18,8 @@ class DnscryptProxy < Formula depends_on "libtool" => :build end - option "plugins", "Support plugins and install example plugins." + option "with-plugins", "Support plugins and install example plugins." + deprecated_option "plugins" => "with-plugins" depends_on "libsodium" @@ -28,7 +27,7 @@ class DnscryptProxy < Formula system "autoreconf", "-if" if build.head? args = ["--disable-dependency-tracking", "--prefix=#{prefix}"] - if build.include? "plugins" + if build.with? "plugins" args << "--enable-plugins" args << "--enable-relaxed-plugins-permissions" args << "--enable-plugins-root" @@ -94,4 +93,8 @@ class DnscryptProxy < Formula EOS end + + test do + system "#{bin}/hostip", "-r", "8.8.8.8", "www.google.com" + end end