40 lines
1.1 KiB
Ruby
40 lines
1.1 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.1",
|
|
:revision => "b7e940a6383c9d1f013288081dcc2a395c68448b"
|
|
head "https://github.com/Flinesoft/BartyCrouch.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "725bb849db135f7d2975526d342e1d83754b94ceebea3473c4ed919b67b75e0a" => :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
|