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-01-29 03:04:44 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/17657/dartsdk-macos-64.zip'
|
|
|
|
sha1 '440936b9dd5c48b5fbf769adaf5d092355a342b1'
|
2012-08-15 19:56:23 +00:00
|
|
|
else
|
2013-01-29 03:04:44 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/17657/dartsdk-macos-32.zip'
|
|
|
|
sha1 '6b3ef69af8ab468e612322c454284150588af050'
|
2012-08-15 19:56:23 +00:00
|
|
|
end
|
|
|
|
|
2013-01-29 03:04:44 +00:00
|
|
|
version '17657'
|
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
|
|
|
|
|
|
|
|
def test
|
2012-04-20 05:01:38 +00:00
|
|
|
mktemp do
|
|
|
|
(Pathname.pwd+'sample.dart').write <<-EOS.undent
|
|
|
|
void main() {
|
|
|
|
Options opts = new Options();
|
|
|
|
for (String arg in opts.arguments) {
|
|
|
|
print(arg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
|
|
|
|
`#{bin}/dart sample.dart test message` == "test\nmessage\n"
|
|
|
|
end
|
2011-12-18 04:19:38 +00:00
|
|
|
end
|
|
|
|
end
|