42 lines
1.2 KiB
Ruby
42 lines
1.2 KiB
Ruby
class Bartycrouch < Formula
|
|
desc "Incrementally update/translate your Strings files"
|
|
homepage "https://github.com/Flinesoft/BartyCrouch"
|
|
url "https://github.com/Flinesoft/BartyCrouch.git",
|
|
:tag => "4.0.2",
|
|
:revision => "7d4cfec9530c7364727a4461712b54909f8d4a90"
|
|
head "https://github.com/Flinesoft/BartyCrouch.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "cd91ef1da39fd877372b3035e740bd4b87ee7fc4421dab0bf243be0f3441b725" => :catalina
|
|
sha256 "3ccf1146ffb56b4bf49fd15cccdf1982d92c79a3eaba4577b0fabce4b6f8be76" => :mojave
|
|
end
|
|
|
|
depends_on :xcode => ["10.2", :build]
|
|
|
|
def install
|
|
system "make", "install", "prefix=#{prefix}"
|
|
end
|
|
|
|
test do
|
|
(testpath/"Test.swift").write <<~EOS
|
|
import Foundation
|
|
|
|
class Test {
|
|
func test() {
|
|
NSLocalizedString("test", comment: "")
|
|
}
|
|
}
|
|
EOS
|
|
|
|
(testpath/"en.lproj/Localizable.strings").write <<~EOS
|
|
/* No comment provided by engineer. */
|
|
"oldKey" = "Some translation";
|
|
EOS
|
|
|
|
system bin/"bartycrouch", "update"
|
|
assert_match /"oldKey" = "/, File.read("en.lproj/Localizable.strings")
|
|
assert_match /"test" = "/, File.read("en.lproj/Localizable.strings")
|
|
end
|
|
end
|