2015-04-30 16:00:05 +00:00
|
|
|
class Natalie < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Storyboard Code Generator (for Swift)"
|
2015-04-30 16:00:05 +00:00
|
|
|
homepage "https://github.com/krzyzanowskim/Natalie"
|
2015-06-20 22:01:50 +00:00
|
|
|
url "https://github.com/krzyzanowskim/Natalie/archive/0.2.tar.gz"
|
|
|
|
sha256 "a4dd246db70e8818ecde34df68a60d8bf15c51465b365f466e606f74e41714e9"
|
2015-04-30 16:00:05 +00:00
|
|
|
head "https://github.com/krzyzanowskim/Natalie.git"
|
|
|
|
|
2015-08-10 13:25:51 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha256 "4524f95293b7d838886370600f7350cfec1796e06bac2e67c3199f6fc73f9bb2" => :yosemite
|
|
|
|
end
|
|
|
|
|
2015-04-30 16:00:05 +00:00
|
|
|
depends_on :xcode => "6.3"
|
|
|
|
|
|
|
|
def install
|
2015-07-13 04:41:51 +00:00
|
|
|
mv "natalie.swift", "natalie-script.swift"
|
|
|
|
system "xcrun", "-sdk", "macosx", "swiftc", "-O", "natalie-script.swift", "-o", "natalie.swift"
|
2015-04-30 16:00:05 +00:00
|
|
|
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
|