-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruss.rb
57 lines (49 loc) · 1.56 KB
/
truss.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class Truss < Formula
desc "Truss helps you build go-kit microservices without having to worry about writing or maintaining boilerplate code"
homepage "https://github.com/metaverse/truss"
version "0.3.1"
bottle :unneeded
on_macos do
if Hardware::CPU.intel?
url "https://github.com/metaverse/truss/releases/download/v0.3.1/truss_0.3.1_Darwin_x86_64.tar.gz"
sha256 "39f9de7a505bd74e56cd8c95c4312bd8a1842e873a39c99853fff3b54ec88d4d"
end
end
on_linux do
if Hardware::CPU.intel?
url "https://github.com/metaverse/truss/releases/download/v0.3.1/truss_0.3.1_Linux_x86_64.tar.gz"
sha256 "4c2a48818b1fb9b6e93c4cdd4e3e823021ed608615c23338810dfeae86972d74"
end
end
depends_on "protobuf"
depends_on "protoc-gen-gogo"
depends_on "protoc-gen-gogofaster"
def install
bin.install "truss"
end
def caveats; <<~EOS
To leverage truss's annotations you'll need to clone truss into your $(go env GOPATH)
EOS
end
test do
system "#{bin}/truss --version"
protofile = testpath/"proto3.proto"
protofile.write <<~EOS
syntax = "proto3";
package proto3;
service Echo {
rpc Echo(Request) returns (Request) { }
}
message Request {
string text = 1;
}
EOS
system "#{bin}/truss", "proto3.proto"
assert_predicate testpath/"proto3.pb.go", :exist?
assert_predicate testpath/echo-service, :exist?
refute_predicate (testpath/"proto3.pb.go").size, :zero?
end
end