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-09-02 10:59:27 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/26639/dartsdk-macos-64.zip'
|
|
|
|
sha1 '05ea242a3699cae6495166286395969a1498d526'
|
2012-08-15 19:56:23 +00:00
|
|
|
else
|
2013-09-02 10:59:27 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/26639/dartsdk-macos-32.zip'
|
|
|
|
sha1 '53388f18e4a01e287bf097ad51a764e4f907229a'
|
2012-08-15 19:56:23 +00:00
|
|
|
end
|
|
|
|
|
2013-09-02 10:59:27 +00:00
|
|
|
version '26639'
|
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
|