homebrew-core/Formula/dart.rb

35 lines
878 B
Ruby
Raw Normal View History

require 'formula'
class Dart < Formula
homepage 'http://www.dartlang.org/'
if MacOS.prefer_64_bit?
url 'https://gsdview.appspot.com/dart-editor-archive-integration/21823/dartsdk-macos-64.zip'
sha1 '6a901c5ba2e18696cab80d02f071656dcb5b2fc1'
else
url 'https://gsdview.appspot.com/dart-editor-archive-integration/21823/dartsdk-macos-32.zip'
sha1 '200c7db0cf092518ab6d7a61dcc9d724ce2e10ae'
end
version '21823'
def install
libexec.install Dir['*']
bin.install_symlink "#{libexec}/bin/dart"
bin.write_exec_script Dir["#{libexec}/bin/{pub,dart?*}"]
end
2013-02-02 05:12:32 +00:00
test do
(testpath/'sample.dart').write <<-EOS.undent
void main() {
Options opts = new Options();
for (String arg in opts.arguments) {
print(arg);
}
}
2013-02-02 05:12:32 +00:00
EOS
2013-02-02 05:12:32 +00:00
`#{bin}/dart sample.dart test message` == "test\nmessage\n"
end
end