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/21658/dartsdk-macos-64.zip'
sha1 '4bae23519e9d2f16d6b296b87053343f16d3e076'
else
url 'https://gsdview.appspot.com/dart-editor-archive-integration/21658/dartsdk-macos-32.zip'
sha1 'c4828db4dc18f388a1b9b928f701a093075850a6'
end
version '21658'
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