<commit_before>require "formula"

class Nikto < Formula
  homepage "http://cirt.net/nikto2"
  url "https://www.cirt.net/nikto/nikto-2.1.5.tar.bz2"
  sha1 "9fafa51f630ce241aff58b217882e514d577939f"

  def install
    # adjust default paths in perl script
    inreplace "nikto.pl", "/etc/nikto.conf", "#{etc}/nikto.conf"

    # adjust default paths in configuration file
    inreplace "nikto.conf" do |s|
      s.gsub! "# EXECDIR=/opt/nikto", "EXECDIR=#{prefix}"
      s.gsub! "# PLUGINDIR=/opt/nikto/plugins", "PLUGINDIR=#{prefix}/plugins"
      s.gsub! "# DBDIR=/opt/nikto/databases", "DBDIR=#{var}/lib/nikto/databases"
      s.gsub! "# TEMPLATEDIR=/opt/nikto/templates", "TEMPLATEDIR=#{prefix}/templates"
      s.gsub! "# DOCDIR=/opt/nikto/docs", "DOCDIR=#{prefix}/docs"
    end

    bin.install "nikto.pl" => "nikto"
    etc.install "nikto.conf"
    man1.install "docs/nikto.1"
    share.install "docs"
    prefix.install "plugins", "templates"
    (var+"lib/nikto/databases").mkpath
  end

  def post_install
    system "#{bin}/nikto", "-update"
  end
end
<commit_msg>nikto: general cleanup.<commit_after>class Nikto < Formula
  homepage "http://cirt.net/nikto2"
  url "https://www.cirt.net/nikto/nikto-2.1.5.tar.bz2"
  sha1 "9fafa51f630ce241aff58b217882e514d577939f"

  def install
    inreplace "nikto.pl", "/etc/nikto.conf", "#{etc}/nikto.conf"

    inreplace "nikto.conf" do |s|
      s.gsub! "# EXECDIR=/opt/nikto", "EXECDIR=#{prefix}"
      s.gsub! "# PLUGINDIR=/opt/nikto/plugins", "PLUGINDIR=#{prefix}/plugins"
      s.gsub! "# DBDIR=/opt/nikto/databases", "DBDIR=#{var}/lib/nikto/databases"
      s.gsub! "# TEMPLATEDIR=/opt/nikto/templates", "TEMPLATEDIR=#{prefix}/templates"
      s.gsub! "# DOCDIR=/opt/nikto/docs", "DOCDIR=#{prefix}/docs"
    end

    bin.install "nikto.pl" => "nikto"
    etc.install "nikto.conf"
    man1.install "docs/nikto.1"
    share.install "docs"
    prefix.install "plugins", "templates"
    (var+"lib/nikto/databases").mkpath
  end

  def post_install
    system "#{bin}/nikto", "-update"
  end
end

{'fraction_non_alphanumeric': 0.1772771792360431, 'fraction_numerical': 0.03330068560235064, 'mean_word_length': 3.5099337748344372, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4177877', 'n_tokens_mistral': 855, 'n_tokens_neox': 801, 'n_words': 128}