<commit_before>class Mpdas < Formula
  desc "C++ client to submit tracks to audioscrobbler"
  homepage "https://www.50hz.ws/mpdas/"
  url "https://www.50hz.ws/mpdas/mpdas-0.4.5.tar.gz"
  sha256 "c9103d7b897e76cd11a669e1c062d74cb73574efc7ba87de3b04304464e8a9ca"
  license "BSD-3-Clause"
  head "https://github.com/hrkfdn/mpdas.git"

  bottle do
    sha256 arm64_big_sur: "88b82424c0013b5c0261fe9f08aea489466a33b59321878f19b924325e25bdf9"
    sha256 big_sur:       "91ac2d2c0a96b2a91becbf3f6d3f34f01031ed507efce5e5a6eca0d3cdabc41c"
    sha256 catalina:      "db93645db3fef2737193f310b8261a435ad79c426e186c6127017b37cc81ef66"
    sha256 mojave:        "448514d6ac177e771f61bcd178550e317560cf3d5d73bfd240c3278d8d3f5193"
    sha256 high_sierra:   "ae319b22981a8cc5ed9a0e0212f2ecdbd7660bcd32182334865a01ac69c2832f"
    sha256 sierra:        "06fe51aaa95bfd3000f1f9e562709d266ecbf1880d2b96779ff0c9b9d82dea20"
    sha256 el_capitan:    "c9261f50d1d71969474203f6431d7902198c3524d828ed6f690733094444a914"
  end

  depends_on "pkg-config" => :build
  depends_on "libmpdclient"

  def install
    system "make", "PREFIX=#{prefix}", "MANPREFIX=#{man1}", "CONFIG=#{etc}", "install"
    etc.install "mpdasrc.example"
  end

  plist_options manual: "mpdas"

  def plist
    <<~EOS
      <?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>WorkingDirectory</key>
          <string>#{HOMEBREW_PREFIX}</string>
          <key>ProgramArguments</key>
          <array>
              <string>#{opt_bin}/mpdas</string>
          </array>
          <key>RunAtLoad</key>
          <true/>
          <key>KeepAlive</key>
          <true/>
      </dict>
      </plist>
    EOS
  end

  test do
    system bin/"mpdas", "-v"
  end
end<commit_msg>mpdas: replace `plist` with `service`<commit_after>class Mpdas < Formula
  desc "C++ client to submit tracks to audioscrobbler"
  homepage "https://www.50hz.ws/mpdas/"
  url "https://www.50hz.ws/mpdas/mpdas-0.4.5.tar.gz"
  sha256 "c9103d7b897e76cd11a669e1c062d74cb73574efc7ba87de3b04304464e8a9ca"
  license "BSD-3-Clause"
  head "https://github.com/hrkfdn/mpdas.git"

  bottle do
    sha256 arm64_big_sur: "88b82424c0013b5c0261fe9f08aea489466a33b59321878f19b924325e25bdf9"
    sha256 big_sur:       "91ac2d2c0a96b2a91becbf3f6d3f34f01031ed507efce5e5a6eca0d3cdabc41c"
    sha256 catalina:      "db93645db3fef2737193f310b8261a435ad79c426e186c6127017b37cc81ef66"
    sha256 mojave:        "448514d6ac177e771f61bcd178550e317560cf3d5d73bfd240c3278d8d3f5193"
    sha256 high_sierra:   "ae319b22981a8cc5ed9a0e0212f2ecdbd7660bcd32182334865a01ac69c2832f"
    sha256 sierra:        "06fe51aaa95bfd3000f1f9e562709d266ecbf1880d2b96779ff0c9b9d82dea20"
    sha256 el_capitan:    "c9261f50d1d71969474203f6431d7902198c3524d828ed6f690733094444a914"
  end

  depends_on "pkg-config" => :build
  depends_on "libmpdclient"

  def install
    system "make", "PREFIX=#{prefix}", "MANPREFIX=#{man1}", "CONFIG=#{etc}", "install"
    etc.install "mpdasrc.example"
  end

  service do
    run opt_bin/"mpdas"
    keep_alive true
    working_dir HOMEBREW_PREFIX
  end

  test do
    system bin/"mpdas", "-v"
  end
end
{'fraction_non_alphanumeric': 0.10523150932050511, 'fraction_numerical': 0.22459410703547805, 'mean_word_length': 3.8998527245949925, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 1, '>': 31, 'https://': 6, 'lorem ipsum': 0, 'www.': 5, 'xml': 1}, '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': '6109983', 'n_tokens_mistral': 1857, 'n_tokens_neox': 1474, 'n_words': 183}