homebrew-core/Formula/jc.rb

48 lines
2.0 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/bf/34/1145fb85a333524b06d562f803a85e09e73902f8adf88c8e48cd4e23ae29/jc-1.12.1.tar.gz"
sha256 "b7ffbc90720681fd09033e21301471b673cebfaa29016cdd01630055e3c9226d"
license "MIT"
bottle do
cellar :any_skip_relocation
sha256 "4df1c743ae937579620e1a61431d9214ffd954e929e88d9cad7e0fa81fd77989" => :catalina
sha256 "d6d4ecf1e1d84b08f3e8ba45ce5aa9d3ef49802ddb436ba4d0549c9ff4e32a7b" => :mojave
sha256 "f894e71d64160f0a02ba8ee972f5b739ceb9ad540bce37566e288d6ed74ed358" => :high_sierra
end
depends_on "python@3.8"
resource "ruamel.yaml" do
url "https://files.pythonhosted.org/packages/16/8b/54a26c1031595e5edd0e616028b922d78d8ffba8bc775f0a4faeada846cc/ruamel.yaml-0.16.10.tar.gz"
sha256 "099c644a778bf72ffa00524f78dd0b6476bca94a1da344130f4bf3381ce5b954"
end
resource "ruamel.yaml.clib" do
url "https://files.pythonhosted.org/packages/92/28/612085de3fae9f82d62d80255d9f4cf05b1b341db1e180adcf28c1bf748d/ruamel.yaml.clib-0.2.0.tar.gz"
sha256 "b66832ea8077d9b3f6e311c4a53d06273db5dc2db6e8a908550f3c14d67e718c"
end
resource "xmltodict" do
url "https://files.pythonhosted.org/packages/58/40/0d783e14112e064127063fbf5d1fe1351723e5dfe9d6daad346a305f6c49/xmltodict-0.12.0.tar.gz"
sha256 "50d8c638ed7ecb88d90561beedbf720c9b4e851a9fa6c47ebd64e99d166d8a21"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/6e/4d/4d2fe93a35dfba417311a4ff627489a947b01dc0cc377a3673c00cf7e4b2/Pygments-2.6.1.tar.gz"
sha256 "647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f3558049b38f44"
end
def install
virtualenv_install_with_resources
end
test do
assert_equal "[{\"header1\": \"data1\", \"header2\": \"data2\"}]\n", \
pipe_output("#{bin}/jc --csv", "header1, header2\n data1, data2")
end
end