<commit_before>require 'formula'

class Denyhosts < Formula
  url 'http://downloads.sourceforge.net/project/denyhosts/denyhosts/2.6/DenyHosts-2.6.tar.gz'
  homepage 'http://denyhosts.sourceforge.net/'
  md5 'fc2365305a9402886a2b0173d1beb7df'

  def patches
    # The original DenyHosts scripts will be installed to libexec with the
    # `-dist` suffixes. The patchfile modifies the copies to set some defaults.
    cp 'daemon-control-dist', 'daemon-control'
    cp 'denyhosts.cfg-dist', 'denyhosts.cfg'
    DATA
  end

  def install
    # If the `libpath` is relative, instead of absolute, we can influence the
    # 'data path' via command line arguments to `setup.py`.
    inreplace 'setup.py' do |s|
      s.change_make_var! 'libpath', "''"
    end

    # Make it so that all DenyHosts tools have a default path that points at
    # our config file.
    inreplace 'DenyHosts/constants.py' do |s|
      s.change_make_var! 'CONFIG_FILE', etc + 'denyhosts.cfg'
    end<commit_msg>DenyHosts: Fix CONFIG_FILE in constants.py<commit_after>require 'formula'

class Denyhosts < Formula
  url 'http://downloads.sourceforge.net/project/denyhosts/denyhosts/2.6/DenyHosts-2.6.tar.gz'
  homepage 'http://denyhosts.sourceforge.net/'
  md5 'fc2365305a9402886a2b0173d1beb7df'

  def patches
    # The original DenyHosts scripts will be installed to libexec with the
    # `-dist` suffixes. The patchfile modifies the copies to set some defaults.
    cp 'daemon-control-dist', 'daemon-control'
    cp 'denyhosts.cfg-dist', 'denyhosts.cfg'
    DATA
  end

  def install
    # If the `libpath` is relative, instead of absolute, we can influence the
    # 'data path' via command line arguments to `setup.py`.
    inreplace 'setup.py' do |s|
      s.change_make_var! 'libpath', "''"
    end

    # Make it so that all DenyHosts tools have a default path that points at
    # our config file.
    inreplace 'DenyHosts/constants.py' do |s|
      s.change_make_var! 'CONFIG_FILE', "'#{etc}/denyhosts.cfg'"
    end
{'fraction_non_alphanumeric': 0.10381143430290872, 'fraction_numerical': 0.026078234704112337, 'mean_word_length': 3.42350332594235, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5283524', 'n_tokens_mistral': 728, 'n_tokens_neox': 684, 'n_words': 198}