homebrew-core/Formula/bartycrouch.rb

43 lines
1.3 KiB
Ruby

class Bartycrouch < Formula
desc "Incrementally update/translate your Strings files"
homepage "https://github.com/FlineDev/BartyCrouch"
url "https://github.com/FlineDev/BartyCrouch.git",
tag: "4.13.0",
revision: "36cc46399abe717986cda40ccd6d6eb34c6ff70d"
license "MIT"
head "https://github.com/FlineDev/BartyCrouch.git", branch: "main"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "451f872bb60d12f471624c23dad49f040abfb23d0cc4eecd6f8970e59772460f"
sha256 cellar: :any_skip_relocation, monterey: "f2860b77f98f794025464a34cf1a565c8991336850d9f88cd8b5c57d3498ab3a"
end
depends_on xcode: ["14.0", :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