benthos 2.9.3 (new formula)
Closes #42421. Signed-off-by: Chongyu Zhu <i@lembacon.com>
This commit is contained in:
parent
6f7be63a8a
commit
838e42706d
1 changed files with 47 additions and 0 deletions
47
Formula/benthos.rb
Normal file
47
Formula/benthos.rb
Normal 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
|
Loading…
Reference in a new issue