<commit_before>class Mpdscribble < Formula
  desc "Last.fm reporting client for mpd"
  homepage "https://www.musicpd.org/clients/mpdscribble/"
  url "https://www.musicpd.org/download/mpdscribble/0.22/mpdscribble-0.22.tar.gz"
  sha256 "ff882d02bd830bdcbccfe3c3c9b0d32f4f98d9becdb68dc3135f7480465f1e38"
  revision 2

  bottle do
    sha256 arm64_big_sur: "e0a631278cb1d14dc4ad63897a68eebd23e5882c4fd9247099d5af1e3e545b4e"
    sha256 big_sur:       "b79e64ee861ea63530317a540dc37222f202a63b59810660b0f94538c16e7334"
    sha256 catalina:      "d8e226d580e44da3f93849bfdd6065a356e9d0e2cf086c31cc4be273e3152980"
    sha256 mojave:        "f6c7e1d2b4f6112ae2b0548e0571580f4f671789e81eb799efc92ac236cd2d0b"
    sha256 high_sierra:   "68c6dcdc89b8cbdd8b8c5fea0822cfdb883874b390cb5a9a69192880a3b03838"
    sha256 sierra:        "bfc893a2fe7e712bfc17f83aeb7e5f9cf46d260f3d5756cd499a6a6100c1feec"
  end

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

  def install
    system "./configure", "--prefix=#{prefix}", "--sysconfdir=#{etc}"
    system "make", "install"
  end

  def caveats
    <<~EOS
      The configuration file was placed in #{etc}/mpdscribble.conf
    EOS
  end

  plist_options manual: "mpdscribble"

  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}/mpdscribble</string>
              <string>--no-daemon</string>
          </array>
          <key>RunAtLoad</key>
          <true/>
          <key>KeepAlive</key>
          <true/>
      </dict>
      </plist>
    EOS
  end

  test do
    system "#{bin}/mpdscribble", "--version"
  end
end<commit_msg>mpdscribble 0.23<commit_after>class Mpdscribble < Formula
  desc "Last.fm reporting client for mpd"
  homepage "https://www.musicpd.org/clients/mpdscribble/"
  url "https://www.musicpd.org/download/mpdscribble/0.23/mpdscribble-0.23.tar.xz"
  sha256 "a3387ed9140eb2fca1ccaf9f9d2d9b5a6326a72c9bcd4119429790c534fec668"
  license "GPL-2.0-or-later"

  livecheck do
    url :homepage
    regex(/href=.*?mpdscribble[._-]v?(\d+(?:\.\d+)+)\.t/i)
  end

  bottle do
    sha256 arm64_big_sur: "e0a631278cb1d14dc4ad63897a68eebd23e5882c4fd9247099d5af1e3e545b4e"
    sha256 big_sur:       "b79e64ee861ea63530317a540dc37222f202a63b59810660b0f94538c16e7334"
    sha256 catalina:      "d8e226d580e44da3f93849bfdd6065a356e9d0e2cf086c31cc4be273e3152980"
    sha256 mojave:        "f6c7e1d2b4f6112ae2b0548e0571580f4f671789e81eb799efc92ac236cd2d0b"
    sha256 high_sierra:   "68c6dcdc89b8cbdd8b8c5fea0822cfdb883874b390cb5a9a69192880a3b03838"
    sha256 sierra:        "bfc893a2fe7e712bfc17f83aeb7e5f9cf46d260f3d5756cd499a6a6100c1feec"
  end

  depends_on "boost" => :build
  depends_on "meson" => :build
  depends_on "ninja" => :build
  depends_on "pkg-config" => :build
  depends_on "libgcrypt"
  depends_on "libmpdclient"

  uses_from_macos "curl"

  def install
    mkdir "build" do
      system "meson", *std_meson_args, "--sysconfdir=#{etc}", ".."
      system "ninja"
      system "ninja", "install"
    end
  end

  def caveats
    <<~EOS
      The configuration file has been placed in #{etc}/mpdscribble.conf.
    EOS
  end

  plist_options manual: "mpdscribble"

  service do
    run [opt_bin/"mpdscribble", "--no-daemon"]
    keep_alive true
    working_dir HOMEBREW_PREFIX
  end

  test do
    system "#{bin}/mpdscribble", "--version"
  end
end
{'fraction_non_alphanumeric': 0.11018989034501203, 'fraction_numerical': 0.16715699384862262, 'mean_word_length': 3.5060240963855422, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 1, '>': 36, 'https://': 4, 'lorem ipsum': 0, 'www.': 5, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7448878', 'n_tokens_mistral': 1924, 'n_tokens_neox': 1599, 'n_words': 221}