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-10-13 14:09:21 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/28355/dartsdk-macos-64.zip'
|
|
|
|
sha1 '577d4bab25dc7fd98318e42c75c6a15b5306aa47'
|
2012-08-15 19:56:23 +00:00
|
|
|
else
|
2013-10-13 14:09:21 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/28355/dartsdk-macos-32.zip'
|
|
|
|
sha1 '10e5abc3b538c94ff145e7cd7d7de3689a7ba4d3'
|
2012-08-15 19:56:23 +00:00
|
|
|
end
|
|
|
|
|
2013-10-13 14:09:21 +00:00
|
|
|
version '28355'
|
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
|