<commit_before>require 'formula'

class Ngspice < Formula
  homepage 'http://ngspice.sourceforge.net/'
  url 'http://downloads.sourceforge.net/project/ngspice/ng-spice-rework/24/ngspice-24.tar.gz'
  sha1 'a6bb0e65c1c07d48f1d3e4df44fc17f6262952eb'

  option "without-xspice", "Build without x-spice extensions"

  depends_on :x11

  def install
    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
      --with-editline=yes
      --enable-x
    ]
    args << "--enable-xspice" unless build.include? "without-xspice"

    system "./configure", *args
    system "make install"
  end

  def caveats;
    "Note: ngspice is an X11 application."
 end
end
<commit_msg>ngspice: fix test and X11 dependency.<commit_after>require 'formula'

class Ngspice < Formula
  homepage 'http://ngspice.sourceforge.net/'
  url 'http://downloads.sourceforge.net/project/ngspice/ng-spice-rework/24/ngspice-24.tar.gz'
  sha1 'a6bb0e65c1c07d48f1d3e4df44fc17f6262952eb'

  option "with-x", "Build with X support"
  option "without-xspice", "Build without x-spice extensions"

  depends_on :x11 if MacOS::X11.installed? or build.include? "with-x"

  def install
    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
      --with-editline=yes
    ]
    args << "--enable-x" if build.include? "with-x"
    args << "--enable-xspice" unless build.include? "without-xspice"

    system "./configure", *args
    system "make install"
  end

  def test
    system "#{bin}/ngspice", "-v"
  end
end

{'fraction_non_alphanumeric': 0.1360318513603185, 'fraction_numerical': 0.043795620437956206, 'mean_word_length': 3.212290502793296, 'pattern_counts': {'":': 0, '<': 11, '<?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': '7416260', 'n_tokens_mistral': 597, 'n_tokens_neox': 550, 'n_words': 115}