homebrew-core/Formula/dart.rb

36 lines
913 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/25388/dartsdk-macos-64.zip'
sha1 '1de7b3933d4c13eb2aac136b2e260ebb3e0af14e'
else
url 'https://gsdview.appspot.com/dart-editor-archive-integration/25388/dartsdk-macos-32.zip'
sha1 'cd59aa7bb25f92b67399a2e05e7bebde3c15d684'
end
version '25388'
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
2013-06-11 14:42:12 +00:00
import 'dart:io';
void main() {
Options opts = new Options();
for (String arg in opts.arguments) {
print(arg);
}
}
2013-02-02 05:12:32 +00:00
EOS
2013-06-09 02:26:19 +00:00
assert_equal "test\nmessage\n", `#{bin}/dart sample.dart test message`
end
end