36 lines
1.2 KiB
Ruby
36 lines
1.2 KiB
Ruby
require "language/node"
|
|
|
|
class Autorest < Formula
|
|
desc "Swagger (OpenAPI) Specification code generator"
|
|
homepage "https://github.com/Azure/autorest"
|
|
url "https://registry.npmjs.org/autorest/-/autorest-3.2.1.tgz"
|
|
sha256 "b5593a2f95fcb49947c3e7bb55cb886e57be3d4378a9c7622243649415076b32"
|
|
license "MIT"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "56e9e69374c91a8ebc18523b8e59e175f765978e3f4104b50338307d8a9486c4"
|
|
end
|
|
|
|
depends_on arch: :x86_64
|
|
depends_on "node"
|
|
|
|
resource "homebrew-petstore" do
|
|
url "https://raw.githubusercontent.com/Azure/autorest/5c170a02c009d032e10aa9f5ab7841e637b3d53b/Samples/1b-code-generation-multilang/petstore.yaml"
|
|
sha256 "e981f21115bc9deba47c74e5c533d92a94cf5dbe880c4304357650083283ce13"
|
|
end
|
|
|
|
def install
|
|
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
|
|
bin.install_symlink Dir["#{libexec}/bin/*"]
|
|
end
|
|
|
|
test do
|
|
resource("homebrew-petstore").stage do
|
|
system (bin/"autorest"), "--input-file=petstore.yaml",
|
|
"--nodejs",
|
|
"--output-folder=petstore"
|
|
assert_includes File.read("petstore/package.json"), "Microsoft Corporation"
|
|
end
|
|
end
|
|
end
|