<commit_before>require 'formula'

class Zxcc < Formula
  homepage 'http://www.seasip.info/Unix/Zxcc/'
  url 'http://www.seasip.info/Unix/Zxcc/zxcc-0.5.7.tar.gz'
  sha1 'cc088ef24b2a62fc2673a593982dd62c16136f18'

  def install
    system "./configure", "--prefix=#{prefix}"
    system "make"
    system "make check"
    system "make install"
  end

  test do
    code = [
      0x11, 0x0b, 0x01,   # 0100 ld de,010bh
      0x0e, 0x09,         # 0103 ld c,cwritestr
      0xcd, 0x05, 0x00,   # 0105 call bdos
      0xc3, 0x00, 0x00,   # 0108 jp warm
      0x48, 0x65, 0x6c,   # 010b db "Hel"
      0x6c, 0x6f, 0x24    # 010e db "lo$"
    ].pack("c*")

    path = testpath/"hello.com"
    path.binwrite code

    assert_equal "Hello", shell_output("#{bin}/zxcc #{path}").strip
  end
end<commit_msg>zxcc: modernize<commit_after>class Zxcc < Formula
  homepage "http://www.seasip.info/Unix/Zxcc/"
  url "http://www.seasip.info/Unix/Zxcc/zxcc-0.5.7.tar.gz"
  sha1 "cc088ef24b2a62fc2673a593982dd62c16136f18"

  def install
    system "./configure", "--prefix=#{prefix}"
    system "make"
    system "make", "check"
    system "make", "install"
  end

  test do
    code = [
      0x11, 0x0b, 0x01,   # 0100 ld de,010bh
      0x0e, 0x09,         # 0103 ld c,cwritestr
      0xcd, 0x05, 0x00,   # 0105 call bdos
      0xc3, 0x00, 0x00,   # 0108 jp warm
      0x48, 0x65, 0x6c,   # 010b db "Hel"
      0x6c, 0x6f, 0x24    # 010e db "lo$"
    ].pack("c*")

    path = testpath/"hello.com"
    path.binwrite code

    assert_equal "Hello", shell_output("#{bin}/zxcc #{path}").strip
  end
end
{'fraction_non_alphanumeric': 0.14376187460417986, 'fraction_numerical': 0.12539582013932868, 'mean_word_length': 2.566591422121896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5773251', 'n_tokens_mistral': 811, 'n_tokens_neox': 691, 'n_words': 146}