<commit_before>class Toralpha < Formula
  desc "Anonymizing overlay network for TCP"
  homepage "https://www.torproject.org/"
  url "https://tor.eff.org/dist/tor-0.3.2.4-alpha.tar.gz"
  mirror "https://dist.torproject.org/tor-0.3.2.4-alpha.tar.gz"
  sha256 "c3ea7826b783d4357a624248d8448480f27838ceb3c1bba02a4a0e5d36564fba"

  bottle :unneeded

  depends_on "pkg-config" => :build
  depends_on "libevent"
  depends_on "openssl"
  depends_on "libscrypt"

  conflicts_with "tor"

  def install
    args = %W[
      --disable-dependency-tracking
      --disable-silent-rules
      --prefix=#{prefix}
      --sysconfdir=#{etc}
      --localstatedir=#{var}
      --with-openssl-dir=#{Formula["openssl"].opt_prefix}
    ]

    system "./configure", *args
    system "make", "install"
  end

  plist_options :manual => "tor"

  def plist; <<-EOS.undent
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>#{plist_name}</string>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
        <key>ProgramArguments</key>
        <array>
            <string>#{opt_bin}/tor</string>
        </array>
        <key>WorkingDirectory</key>
        <string>#{HOMEBREW_PREFIX}</string>
        <key>StandardErrorPath</key>
        <string>#{var}/log/tor.log</string>
        <key>StandardOutPath</key>
        <string>#{var}/log/tor.log</string>
      </dict>
    </plist>
    EOS
  end

  test do
    pipe_output("script -q /dev/null #{bin}/tor-gencert --create-identity-key", "<PASSWORD>\np<PASSWORD>\n")
    assert_predicate testpath/"authority_certificate", :exist?
    assert_predicate testpath/"authority_signing_key", :exist?
    assert_predicate testpath/"authority_identity_key", :exist?
  end

  def caveats; <<-EOS.undent
    This is tracking -alpha, you should not use this if you don't know what you are doing with Tor. This is to help the Tor team test new features like scheduling.
    EOS
  end
end<commit_msg>New syntax for compile options<commit_after>class Toralpha < Formula
  desc 'Anonymizing overlay network for TCP'
  homepage 'https://www.torproject.org/'
  url 'https://tor.eff.org/dist/tor-0.3.2.4-alpha.tar.gz'
  mirror 'https://dist.torproject.org/tor-0.3.2.4-alpha.tar.gz'
  sha256 'c3ea7826b783d4357a624248d8448480f27838ceb3c1bba02a4a0e5d36564fba'

  bottle :unneeded

  depends_on 'pkg-config' => :build
  depends_on 'libevent'
  depends_on 'openssl'
  depends_on 'libscrypt'

  conflicts_with 'tor'

  def install
    args = "
             --disable-dependency-tracking
             --disable-silent-rules
             --prefix=#{prefix}
             --sysconfdir=#{etc}
             --localstatedir=#{var}
             --with-openssl-dir=#{Formula['openssl'].opt_prefix}
           "

    system './configure', *args
    system 'make', 'install'
  end

  plist_options manual: 'tor'

  def plist; <<-EOS.undent
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>#{plist_name}</string>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
        <key>ProgramArguments</key>
        <array>
            <string>#{opt_bin}/tor</string>
        </array>
        <key>WorkingDirectory</key>
        <string>#{HOMEBREW_PREFIX}</string>
        <key>StandardErrorPath</key>
        <string>#{var}/log/tor.log</string>
        <key>StandardOutPath</key>
        <string>#{var}/log/tor.log</string>
      </dict>
    </plist>
    EOS
  end

  test do
    pipe_output("script -q /dev/null #{bin}/tor-gencert --create-identity-key", "<PASSWORD>")
    assert_predicate testpath / 'authority_certificate', :exist?
    assert_predicate testpath / 'authority_signing_key', :exist?
    assert_predicate testpath / 'authority_identity_key', :exist?
  end

  def caveats; <<-EOS.undent
    This is tracking -alpha, you should not use this if you don't know what you are doing with Tor. This is to help the Tor team test new features like scheduling.
    EOS
  end
end
{'fraction_non_alphanumeric': 0.14874301675977653, 'fraction_numerical': 0.028864059590316574, 'mean_word_length': 2.707506471095772, 'pattern_counts': {'":': 0, '<': 84, '<?xml version=': 2, '>': 77, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 4, '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': '1413427', 'n_tokens_mistral': 1589, 'n_tokens_neox': 1496, 'n_words': 287}