2011-12-18 04:19:38 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Dart < Formula
|
|
|
|
homepage 'http://www.dartlang.org/'
|
2012-08-15 19:56:23 +00:00
|
|
|
|
|
|
|
if MacOS.prefer_64_bit?
|
2013-06-25 22:04:44 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/24275/dartsdk-macos-64.zip'
|
|
|
|
sha1 'af75e014b80f27c77ac46cce1ae66fe981490354'
|
2012-08-15 19:56:23 +00:00
|
|
|
else
|
2013-06-25 22:04:44 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/24275/dartsdk-macos-32.zip'
|
|
|
|
sha1 '551c60760205531a1b7a3de62ece82307f1bdad2'
|
2012-08-15 19:56:23 +00:00
|
|
|
end
|
|
|
|
|
2013-06-25 22:04:44 +00:00
|
|
|
version '24275'
|
2011-12-18 04:19:38 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
libexec.install Dir['*']
|
2012-12-07 12:14:40 +00:00
|
|
|
bin.install_symlink "#{libexec}/bin/dart"
|
|
|
|
bin.write_exec_script Dir["#{libexec}/bin/{pub,dart?*}"]
|
2011-12-18 04:19:38 +00:00
|
|
|
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';
|
2012-04-20 05:01:38 +00:00
|
|
|
void main() {
|
|
|
|
Options opts = new Options();
|
|
|
|
for (String arg in opts.arguments) {
|
|
|
|
print(arg);
|
|
|
|
}
|
|
|
|
}
|
2013-02-02 05:12:32 +00:00
|
|
|
EOS
|
2012-04-20 05:01:38 +00:00
|
|
|
|
2013-06-09 02:26:19 +00:00
|
|
|
assert_equal "test\nmessage\n", `#{bin}/dart sample.dart test message`
|
2011-12-18 04:19:38 +00:00
|
|
|
end
|
|
|
|
end
|