2011-12-18 04:19:38 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Dart < Formula
|
|
|
|
homepage 'http://www.dartlang.org/'
|
2012-06-08 02:26:43 +00:00
|
|
|
url 'https://gsdview.appspot.com/dart-editor-archive-integration/8370/dart-macos.zip'
|
|
|
|
version '8370'
|
|
|
|
sha1 '3012ee60ef3ecc082a9ce2cb780feffb488540f5'
|
2011-12-18 04:19:38 +00:00
|
|
|
|
|
|
|
def shim_script target
|
|
|
|
<<-EOS.undent
|
|
|
|
#!/bin/bash
|
|
|
|
exec "#{target}" "$@"
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
libexec.install Dir['*']
|
|
|
|
|
|
|
|
(bin+'dart').write shim_script("#{libexec}/bin/dart")
|
2012-05-17 10:57:31 +00:00
|
|
|
(bin+'dart2js').write shim_script("#{libexec}/bin/dart2js")
|
2012-06-11 10:26:45 +00:00
|
|
|
(bin+'pub').write shim_script("#{libexec}/bin/pub")
|
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
|