benthos 2.9.3 (new formula)

Closes #42421.

Signed-off-by: Chongyu Zhu <i@lembacon.com>
This commit is contained in:
Juan Carlos Alonso 2019-07-25 08:11:18 +01:00 committed by Chongyu Zhu
parent 6f7be63a8a
commit 838e42706d
No known key found for this signature in database
GPG key ID: 1A43E3C9100B38F5

47
Formula/benthos.rb Normal file
View file

@ -0,0 +1,47 @@
class Benthos < Formula
desc "Stream processor for mundane tasks written in Go"
homepage "https://www.benthos.dev"
url "https://github.com/Jeffail/benthos/archive/v2.9.3.tar.gz"
sha256 "40c8e53081ce6ea115dad574769f74b0cd7de467ec4f2212747d867bb10e96bc"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
ENV["GO111MODULE"] = "on"
src = buildpath/"src/github.com/Jeffail/benthos"
src.install buildpath.children
src.cd do
system "make", "VERSION=#{version}"
bin.install "target/bin/benthos"
prefix.install_metafiles
end
end
test do
(testpath/"sample.txt").write <<~EOS
QmVudGhvcyByb2NrcyE=
EOS
(testpath/"test_pipeline.yaml").write <<~EOS
---
logger:
level: ERROR
input:
type: file
file:
path: ./sample.txt
pipeline:
threads: 1
processors:
- type: decode
decode:
scheme: base64
output:
type: stdout
EOS
output = shell_output("#{bin}/benthos -c test_pipeline.yaml")
assert_match "Benthos rocks!", output.strip
end
end