quicktype 6.0.0 (new formula)
Closes #21613. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
parent
55e5d41f92
commit
f5b7c365f4
1 changed files with 27 additions and 0 deletions
27
Formula/quicktype.rb
Normal file
27
Formula/quicktype.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
require "language/node"
|
||||
|
||||
class Quicktype < Formula
|
||||
desc "Generate types and converters from JSON, Schema, and GraphQL"
|
||||
homepage "https://github.com/quicktype/quicktype"
|
||||
url "https://registry.npmjs.org/quicktype/-/quicktype-6.0.0.tgz"
|
||||
sha256 "f615dc2c026a3125039ba4463d8c931a7a771a496366c9aae252512a09a90854"
|
||||
|
||||
depends_on "node"
|
||||
|
||||
def install
|
||||
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
|
||||
bin.install_symlink Dir["#{libexec}/bin/*"]
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"sample.json").write <<~EOS
|
||||
{
|
||||
"i": [0, 1],
|
||||
"s": "quicktype"
|
||||
}
|
||||
EOS
|
||||
code = shell_output "#{bin}/quicktype --lang typescript --src sample.json"
|
||||
assert_match "i: number[];", code
|
||||
assert_match "s: string;", code
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue