<commit_before>require 'formula'

class ContribFonts < Formula
  url 'ftp://ftp.figlet.org:21//pub/figlet/fonts/contributed.tar.gz'
  version "2.2.2"
  md5 '6e2dec4499f7a7fe178522e02e0b6cd1'
end

class InternationalFonts < Formula
  url 'ftp://ftp.figlet.org:21//pub/figlet/fonts/international.tar.gz'
  version "2.2.2"
  md5 'b2d53f7e251014adcdb4d407c47f90ef'
end

class Figlet < Formula
  url 'ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-2.2.4.tar.gz'
  homepage 'http://www.figlet.org'
  md5 'ea048d8d0b56f9c58e55514d4eb04203'

  def fonts
    share + "figlet/fonts"
  end

  def patches
    DATA
  end

  def install
    File.chmod 0666, 'Makefile'
    File.chmod 0666, 'showfigfonts'
    man6.mkpath
    bin.mkpath

    ContribFonts.new.brew { fonts.install Dir['*'] }
    InternationalFonts.new.brew { fonts.install Dir['*'] }

    inreplace "Makefile" do |s|
      s.gsub! "/usr/local/", "#{prefix}/"
      s.change_make_var! 'DEFAULTFONTDIR', fonts
      s.change_make_var! 'MANDIR', man6
    end

    system "make install"
  end
end

__END__
diff --git a/showfigfonts b/showfigfonts
index 643c60b..543379c 100644
--- a/showfigfonts
+++ b/showfigfonts
@@ -14,6 +14,7 @@
 DIRSAVE=`pwd`
 cd `dirname "$0"`
 PATH="$PATH":`pwd`
+FIGDIR=`pwd`
 cd "$DIRSAVE"
 
 # Get figlet version
@@ -42,12 +43,12 @@ else
     FONTDIR="`figlet -F | sed -e '1d' -e '3,$d' -e 's/Font directory: //'`"
   else
     # figlet 2.1 or later
-    FONTDIR="`figlet -I2`"
+    FONTDIR="`${FIGDIR}/figlet -I2`"
   fi
 fi
 
 cd "$FONTDIR"
-FONTLIST=`ls *.flf | sed s/\.flf$//`
+FONTLIST=`ls *.fl* | sed s/\.fl.$//`
 cd $DIRSAVE
 for F in $FONTLIST ; do
   echo "$F" :<commit_msg>figlet: fix compilation<commit_after>require 'formula'

class ContribFonts < Formula
  url 'ftp://ftp.figlet.org:21//pub/figlet/fonts/contributed.tar.gz'
  version "2.2.2"
  md5 '6e2dec4499f7a7fe178522e02e0b6cd1'
end

class InternationalFonts < Formula
  url 'ftp://ftp.figlet.org:21//pub/figlet/fonts/international.tar.gz'
  version "2.2.2"
  md5 'b2d53f7e251014adcdb4d407c47f90ef'
end

class Figlet < Formula
  url 'ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-2.2.4.tar.gz'
  homepage 'http://www.figlet.org'
  md5 'ea048d8d0b56f9c58e55514d4eb04203'

  def install
    share_fonts = share+"figlet/fonts"

    File.chmod 0666, 'Makefile'
    File.chmod 0666, 'showfigfonts'
    man6.mkpath
    bin.mkpath

    ContribFonts.new.brew { share_fonts.install Dir['*'] }
    InternationalFonts.new.brew { share_fonts.install Dir['*'] }

    inreplace "Makefile" do |s|
      s.gsub! "/usr/local/", "#{prefix}/"
      s.change_make_var! 'DEFAULTFONTDIR', share_fonts
      s.change_make_var! 'MANDIR', man6
    end

    system "make install"
  end

  def test
    system "figlet -f larry3d hello, figlet"
  end
end
{'fraction_non_alphanumeric': 0.1507736595897805, 'fraction_numerical': 0.07448722562072688, 'mean_word_length': 3.263803680981595, 'pattern_counts': {'":': 1, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5905553', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1175, 'n_words': 220}