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-07-24 19:22:59 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/25388/dartsdk-macos-64.zip'
|
|
|
|
sha1 '1de7b3933d4c13eb2aac136b2e260ebb3e0af14e'
|
2012-08-15 19:56:23 +00:00
|
|
|
else
|
2013-07-24 19:22:59 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/25388/dartsdk-macos-32.zip'
|
|
|
|
sha1 'cd59aa7bb25f92b67399a2e05e7bebde3c15d684'
|
2012-08-15 19:56:23 +00:00
|
|
|
end
|
|
|
|
|
2013-07-24 19:22:59 +00:00
|
|
|
version '25388'
|
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
|