2012-10-21 22:44:45 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Jq < Formula
|
2013-04-07 02:34:41 +00:00
|
|
|
homepage 'http://stedolan.github.io/jq/'
|
2013-05-23 16:29:36 +00:00
|
|
|
url 'http://stedolan.github.io/jq/download/source/jq-1.3.tar.gz'
|
|
|
|
sha1 'ac1f19e5d9921683af25251e97c2c4bfee895ca2'
|
2012-12-29 18:31:54 +00:00
|
|
|
|
2013-10-28 09:26:44 +00:00
|
|
|
head do
|
|
|
|
url 'https://github.com/stedolan/jq.git'
|
2012-10-21 22:44:45 +00:00
|
|
|
|
2013-10-28 09:26:44 +00:00
|
|
|
depends_on 'autoconf' => :build
|
|
|
|
depends_on 'automake' => :build
|
2013-11-13 17:27:49 +00:00
|
|
|
depends_on 'libtool' => :build
|
2013-10-28 09:26:44 +00:00
|
|
|
depends_on 'bison' => :build
|
|
|
|
end
|
2013-10-19 01:31:10 +00:00
|
|
|
|
2012-10-21 22:44:45 +00:00
|
|
|
def install
|
2013-11-13 17:27:49 +00:00
|
|
|
system "autoreconf", "-iv" if build.head?
|
2013-05-23 16:29:36 +00:00
|
|
|
system "./configure"
|
2012-10-21 22:44:45 +00:00
|
|
|
system "make"
|
|
|
|
bin.install 'jq'
|
2013-05-31 11:01:46 +00:00
|
|
|
man1.install 'jq.1'
|
2012-10-21 22:44:45 +00:00
|
|
|
end
|
2014-02-13 21:02:19 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
IO.popen("#{bin}/jq .bar", "w+") do |pipe|
|
|
|
|
pipe.puts '{"foo":1, "bar":2}'
|
|
|
|
pipe.close_write
|
|
|
|
assert_equal "2\n", pipe.read
|
|
|
|
end
|
|
|
|
end
|
2012-10-21 22:44:45 +00:00
|
|
|
end
|