31 lines
1.1 KiB
Ruby
31 lines
1.1 KiB
Ruby
class Natalie < Formula
|
|
desc "Storyboard Code Generator (for Swift)"
|
|
homepage "https://github.com/krzyzanowskim/Natalie"
|
|
url "https://github.com/krzyzanowskim/Natalie/archive/0.4.2.tar.gz"
|
|
sha256 "2b3e3bd90fca4d4b2406a794abb4f4371c11e673606c3233b9b8e55b2b6b7245"
|
|
head "https://github.com/krzyzanowskim/Natalie.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "a43680f8d24e3523ee7bc680dd570fddaeb4a208d9664f43219b35b918b0cb17" => :el_capitan
|
|
sha256 "49c77d43fca5c3e76dfc00d5d8c4465cb2e98772415a3372b747b9f73b3eeff6" => :yosemite
|
|
end
|
|
|
|
depends_on :xcode => "7.0"
|
|
|
|
def install
|
|
mv "natalie.swift", "natalie-script.swift"
|
|
system "xcrun", "-sdk", "macosx", "swiftc", "-O", "natalie-script.swift", "-o", "natalie.swift"
|
|
bin.install "natalie.swift"
|
|
share.install "NatalieExample"
|
|
end
|
|
|
|
test do
|
|
example_path = "#{share}/NatalieExample"
|
|
output_path = testpath/"Storyboards.swift"
|
|
generated_code = `#{bin}/natalie.swift #{example_path}`
|
|
output_path.write(generated_code)
|
|
line_count = `wc -l #{output_path}`
|
|
assert line_count.to_i > 1
|
|
end
|
|
end
|