2016-11-16 09:13:06 +00:00
|
|
|
class Sbjson < Formula
|
|
|
|
desc "JSON CLI parser & reformatter based on SBJson v5"
|
|
|
|
homepage "https://github.com/stig/json-framework"
|
|
|
|
url "https://github.com/stig/json-framework/archive/v5.0.0.tar.gz"
|
|
|
|
sha256 "e803753a157db475c4b89bddc0f550a5fdd0fc1980428a81ca6116feb2fd52e1"
|
|
|
|
|
|
|
|
head "https://github.com/stig/json-framework.git"
|
|
|
|
|
2016-11-16 09:29:44 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
|
|
|
sha256 "aded461aca135b96288154c6fe6219d7c093a0836dafc6fdec90899256e8f8db" => :sierra
|
|
|
|
sha256 "ce91cd42fb178216f3fe2ef6c617f9ca91a9e981b85142a22a8cc715ab105fc3" => :el_capitan
|
|
|
|
sha256 "46f00ae266cdc64c839ff5ad2f8258eb42bdb7682e8e5201e9acb1f07f449611" => :yosemite
|
|
|
|
end
|
|
|
|
|
2016-11-16 09:13:06 +00:00
|
|
|
depends_on :xcode => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
xcodebuild "-project", "SBJson5.xcodeproj",
|
|
|
|
"-target", "sbjson",
|
|
|
|
"-configuration", "Release",
|
|
|
|
"clean",
|
|
|
|
"build",
|
|
|
|
"SYMROOT=build"
|
|
|
|
|
|
|
|
bin.install "build/Release/sbjson"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"in.json").write <<-EOS.undent
|
|
|
|
[true,false,"string",42.001e3,[],{}]
|
|
|
|
EOS
|
|
|
|
|
|
|
|
(testpath/"unwrapped.json").write <<-EOS.undent
|
|
|
|
true
|
|
|
|
false
|
|
|
|
"string"
|
|
|
|
42001
|
|
|
|
[]
|
|
|
|
{}
|
|
|
|
EOS
|
|
|
|
|
|
|
|
assert_equal shell_output("cat unwrapped.json"),
|
|
|
|
shell_output("#{bin}/sbjson --unwrap-root in.json")
|
|
|
|
end
|
|
|
|
end
|