<commit_before>require 'formula'

class Rrdtool < Formula
  homepage 'http://oss.oetiker.ch/rrdtool/index.en.html'
  url 'http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.7.tar.gz'
  sha1 'faab7df7696b69f85d6f89dd9708d7cf0c9a273b'

  option 'lua', "Compile with lua support"

  depends_on 'glib'
  depends_on 'pango'

  # Can use lua if it is found, but don't force users to install
  # TODO: Do something here
  depends_on 'lua' => :optional if build.include? "lua"

  # Ha-ha, but sleeping is annoying when running configure a lot
  def patches; DATA; end

  def install
    ENV.libxml2

    which_perl = which 'perl'
    which_ruby = which 'ruby'
    ruby_path  = "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby"

    opoo "Using system Ruby. RRD module will be installed to /Library/Ruby/..." if which_ruby.realpath.to_s == ruby_path
    opoo "Using system Perl. RRD module will be installed to /Library/Perl/..." if which_perl.to_s == "/usr/bin/perl"

    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
    ]
    args << "--enable-perl-site-install" if which_perl.to_s == "/usr/bin/perl"
    args << "--enable-ruby-site-install" if which_ruby.realpath.to_s == ruby_path

    system "./configure", *args

    # Needed to build proper Ruby bundle<commit_msg>rrdtool: fix dep<commit_after>require 'formula'

class Rrdtool < Formula
  homepage 'http://oss.oetiker.ch/rrdtool/index.en.html'
  url 'http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.7.tar.gz'
  sha1 'faab7df7696b69f85d6f89dd9708d7cf0c9a273b'

  option 'lua', "Compile with lua support"

  depends_on 'glib'
  depends_on 'pango'

  # Can use lua if it is found, but don't force users to install
  # TODO: Do something here
  depends_on 'lua' if build.include? "lua"

  # Ha-ha, but sleeping is annoying when running configure a lot
  def patches; DATA; end

  def install
    ENV.libxml2

    which_perl = which 'perl'
    which_ruby = which 'ruby'
    ruby_path  = "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby"

    opoo "Using system Ruby. RRD module will be installed to /Library/Ruby/..." if which_ruby.realpath.to_s == ruby_path
    opoo "Using system Perl. RRD module will be installed to /Library/Perl/..." if which_perl.to_s == "/usr/bin/perl"

    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
    ]
    args << "--enable-perl-site-install" if which_perl.to_s == "/usr/bin/perl"
    args << "--enable-ruby-site-install" if which_ruby.realpath.to_s == ruby_path

    system "./configure", *args

    # Needed to build proper Ruby bundle
{'fraction_non_alphanumeric': 0.12548113933795227, 'fraction_numerical': 0.022324865280985373, 'mean_word_length': 3.185185185185185, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5293420', 'n_tokens_mistral': 999, 'n_tokens_neox': 908, 'n_words': 240}