forked from Homebrew/homebrew-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbartycrouch.rb
40 lines (33 loc) · 1.11 KB
/
bartycrouch.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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 "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