43 lines
1.3 KiB
Ruby
43 lines
1.3 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.7.1",
|
|
revision: "c83fe72d329ffbe2afda6b980c62060699ef6bb7"
|
|
license "MIT"
|
|
head "https://github.com/Flinesoft/BartyCrouch.git", branch: "main"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "2826920f37928bdc35e730257969a1b676b36864967a848c196df2b7edee80bd"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "4588599e70c69ce5f5e28c4946978cc09fad5f003368a309df251b45bfca2c5f"
|
|
end
|
|
|
|
depends_on xcode: ["12.5", :build]
|
|
depends_on :macos
|
|
|
|
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
|