homebrew-core/Formula/jc.rb

49 lines
2.2 KiB
Ruby

class Jc < Formula
include Language::Python::Virtualenv
desc "Serializes the output of command-line tools to structured JSON output"
homepage "https://github.com/kellyjonbrazil/jc"
url "https://files.pythonhosted.org/packages/6a/c5/344e04a7ed7811e779cc71936c9d106f3f910d3d5680b6b1e9552bf47cbc/jc-1.15.4.tar.gz"
sha256 "b017ff66c7884a01d6efb81c98b8a24a855d0f98dba4587679c02572a2d409e4"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "88cba1f06ea999e74ceb8efcd3f93fbfda19892b61b4a8ce9a1e8493e5ff129a"
sha256 cellar: :any_skip_relocation, big_sur: "29730db4a0abf2244a20632034f9f456b432e89a79cc5e1ad78e455c5cf78a58"
sha256 cellar: :any_skip_relocation, catalina: "06d01c9f59fe9ee39cf1195e710c8eeb163568ad2c45845423ed4591e147aa98"
sha256 cellar: :any_skip_relocation, mojave: "383be5fb866c39fd73a1ce2988bb55536db7b34d6bcd27911608da9f031fbd6e"
end
depends_on "python@3.9"
resource "Pygments" do
url "https://files.pythonhosted.org/packages/ba/6e/7a7c13c21d8a4a7f82ccbfe257a045890d4dbf18c023f985f565f97393e3/Pygments-2.9.0.tar.gz"
sha256 "a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f"
end
resource "ruamel.yaml" do
url "https://files.pythonhosted.org/packages/62/cf/148028462ab88a71046ba0a30780357ae9e07125863ea9ca7808f1ea3798/ruamel.yaml-0.17.4.tar.gz"
sha256 "44bc6b54fddd45e4bc0619059196679f9e8b79c027f4131bb072e6a22f4d5e28"
end
resource "ruamel.yaml.clib" do
url "https://files.pythonhosted.org/packages/fa/a1/f9c009a633fce3609e314294c7963abe64934d972abea257dce16a15666f/ruamel.yaml.clib-0.2.2.tar.gz"
sha256 "2d24bd98af676f4990c4d715bcdc2a60b19c56a3fb3a763164d2d8ca0e806ba7"
end
resource "xmltodict" do
url "https://files.pythonhosted.org/packages/58/40/0d783e14112e064127063fbf5d1fe1351723e5dfe9d6daad346a305f6c49/xmltodict-0.12.0.tar.gz"
sha256 "50d8c638ed7ecb88d90561beedbf720c9b4e851a9fa6c47ebd64e99d166d8a21"
end
def install
virtualenv_install_with_resources
man1.install "jc/man/jc.1.gz"
end
test do
assert_equal "[{\"header1\":\"data1\",\"header2\":\"data2\"}]\n", \
pipe_output("#{bin}/jc --csv", "header1, header2\n data1, data2")
end
end