<commit_before>require 'formula'

class Dart < Formula
  homepage 'https://www.dartlang.org/'

  if MacOS.prefer_64_bit?
    url 'https://storage.googleapis.com/dart-archive/channels/stable/release/38663/sdk/dartsdk-macos-x64-release.zip'
    sha1 'fc214070863861e444b0a9619dd92a93c0932bc9'
  else
    url 'https://storage.googleapis.com/dart-archive/channels/stable/release/38663/sdk/dartsdk-macos-ia32-release.zip'
    sha1 'd6d2ba9950f3625d15c39814c183364dcd46b945'
  end

  version '1.5.8'

  devel do
    if MacOS.prefer_64_bit?
      url 'https://storage.googleapis.com/dart-archive/channels/dev/release/38831/sdk/dartsdk-macos-x64-release.zip'
      sha1 'ed2bc149a6bb5c8b48b8d818269c0be392dc8361'
    else
      url 'https://storage.googleapis.com/dart-archive/channels/dev/release/38831/sdk/dartsdk-macos-ia32-release.zip'
      sha1 'fccba1c2289faaa83b596f7335e107c7b581e2fe'
    end

    version '1.6.0-dev.7.0'
  end

  def install
    libexec.install Dir['*']
    bin.install_symlink "#{libexec}/bin/dart"
    bin.write_exec_script Dir["#{libexec}/bin/{pub,dart?*}"]
  end

  def caveats; <<-EOS.undent
    To use with IntelliJ, set the Dart home to:
      #{opt_libexec}
    EOS
  end

  test do
    (testpath/'sample.dart').write <<-EOS.undent
      void main() {
        print(r"test message");
      }
    EOS

    assert_equal "test message\n", shell_output("#{bin}/dart sample.dart")
  end
end<commit_msg>dart: add docgen to scripts<commit_after>require 'formula'

class Dart < Formula
  homepage 'https://www.dartlang.org/'

  if MacOS.prefer_64_bit?
    url 'https://storage.googleapis.com/dart-archive/channels/stable/release/38663/sdk/dartsdk-macos-x64-release.zip'
    sha1 'fc214070863861e444b0a9619dd92a93c0932bc9'
  else
    url 'https://storage.googleapis.com/dart-archive/channels/stable/release/38663/sdk/dartsdk-macos-ia32-release.zip'
    sha1 'd6d2ba9950f3625d15c39814c183364dcd46b945'
  end

  version '1.5.8'

  devel do
    if MacOS.prefer_64_bit?
      url 'https://storage.googleapis.com/dart-archive/channels/dev/release/38831/sdk/dartsdk-macos-x64-release.zip'
      sha1 'ed2bc149a6bb5c8b48b8d818269c0be392dc8361'
    else
      url 'https://storage.googleapis.com/dart-archive/channels/dev/release/38831/sdk/dartsdk-macos-ia32-release.zip'
      sha1 'fccba1c2289faaa83b596f7335e107c7b581e2fe'
    end

    version '1.6.0-dev.7.0'
  end

  def install
    libexec.install Dir['*']
    bin.install_symlink "#{libexec}/bin/dart"
    bin.write_exec_script Dir["#{libexec}/bin/{pub,docgen,dart?*}"]
  end

  def caveats; <<-EOS.undent
    To use with IntelliJ, set the Dart home to:
      #{opt_libexec}
    EOS
  end

  test do
    (testpath/'sample.dart').write <<-EOS.undent
      void main() {
        print(r"test message");
      }
    EOS

    assert_equal "test message\n", shell_output("#{bin}/dart sample.dart")
  end
end
{'fraction_non_alphanumeric': 0.12966190310212616, 'fraction_numerical': 0.1024747298710352, 'mean_word_length': 3.3950995405819295, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5062132', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1154, 'n_words': 159}