Skip to content

Commit c19b723

Browse files
openapi 1.6.1 (new formula)
1 parent 18196f8 commit c19b723

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Formula/o/openapi.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
class Openapi < Formula
2+
desc "CLI tools for working with OpenAPI, Arazzo and Overlay specifications"
3+
homepage "https://github.com/speakeasy-api/openapi"
4+
url "https://github.com/speakeasy-api/openapi/archive/refs/tags/v1.6.1.tar.gz"
5+
sha256 "2d1cb22b79b515ba0faefdb721b2d199f8094d76badb671ead88bd1454e76e10"
6+
license "MIT"
7+
head "https://github.com/speakeasy-api/openapi.git", branch: "main"
8+
9+
depends_on "go" => :build
10+
11+
def install
12+
ldflags = %W[
13+
-s -w
14+
-X main.version=#{version}
15+
-X main.commit=#{stable.specs[:revision]}
16+
-X main.date=#{time.iso8601}
17+
]
18+
system "go", "build", *std_go_args(ldflags:), "./cmd/openapi"
19+
20+
generate_completions_from_executable(bin/"openapi", "completion", shells: [:bash, :zsh, :fish, :pwsh])
21+
end
22+
23+
test do
24+
assert_match version.to_s, shell_output("#{bin}/openapi --version")
25+
26+
system bin/"openapi", "spec", "bootstrap", "test-api.yaml"
27+
assert_path_exists testpath/"test-api.yaml"
28+
29+
system bin/"openapi", "spec", "validate", "test-api.yaml"
30+
end
31+
end

0 commit comments

Comments
 (0)