<commit_before>class Ratfor < Formula
  desc "Rational Fortran"
  homepage "http://www.dgate.org/ratfor/"
  url "http://www.dgate.org/ratfor/tars/ratfor-1.05.tar.gz"
  sha256 "826278c5cec11f8956984f146e982137e90b0722af5dde9e8c5bf1fef614853c"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "86d1de3e075edcc1e493b46fc7186bd21906644ba69a7032f3bc827487eb9449"
    sha256 cellar: :any_skip_relocation, big_sur:       "0d9bfcd885197bf8bbfbd38469cd831e16f2dceb6cb6155acf075f0dfebcf095"
    sha256 cellar: :any_skip_relocation, catalina:      "053917ccdf191b7cb15adb1c207cb3f18553def7d4cc9584b09222be07754660"
    sha256 cellar: :any_skip_relocation, mojave:        "054cb6d92e13050233c54a5bbfdd1dc9fbaed09d63937b8426d543d9569ee07b"
    sha256 cellar: :any_skip_relocation, high_sierra:   "16c83b337e66de93f5e1b21d77242b849a4a1613e2c2e38d1971a77277924bce"
    sha256 cellar: :any_skip_relocation, x86_64_linux:  "5469f16aeb09d9ede096088096bbec09f1b8d20351d7bbaf59b36f35eb7e44d0"
  end

  depends_on "gcc" # for gfortran

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

  test do
    (testpath/"test.r").write <<~EOS
      integer x,y
      x=1; y=2
      if(x == y)
              write(6,600)
      else if(x > y)
              write(6,601)
      else
              write(6,602)
      x=1
      while(x < 10){
        if(y != 2) break
        if(y != 2) next
        write(6,603)x
        x=x+1
        }
      repeat
        x=x-1
      until(x == 0)
      for(x=0; x < 10; x=x+1)
              write(6,604)x
      600 format('Wrong, x != y')
      601 format('Also wrong, x < y')
      602 format('Ok!')
      603 format('x = ',i2)
      604 format('x = ',i2)
      end
    EOS

    system "#{bin}/ratfor", "-o", "test.f", testpath/"test.r"
    system "gfortran", "test.f", "-o", "test"
    system "./test"
  end
end
<commit_msg>ratfor: revision for gcc<commit_after>class Ratfor < Formula
  desc "Rational Fortran"
  homepage "http://www.dgate.org/ratfor/"
  url "http://www.dgate.org/ratfor/tars/ratfor-1.05.tar.gz"
  sha256 "826278c5cec11f8956984f146e982137e90b0722af5dde9e8c5bf1fef614853c"
  revision 1 unless OS.mac?

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_big_sur: "86d1de3e075edcc1e493b46fc7186bd21906644ba69a7032f3bc827487eb9449"
    sha256 cellar: :any_skip_relocation, big_sur:       "0d9bfcd885197bf8bbfbd38469cd831e16f2dceb6cb6155acf075f0dfebcf095"
    sha256 cellar: :any_skip_relocation, catalina:      "053917ccdf191b7cb15adb1c207cb3f18553def7d4cc9584b09222be07754660"
    sha256 cellar: :any_skip_relocation, mojave:        "054cb6d92e13050233c54a5bbfdd1dc9fbaed09d63937b8426d543d9569ee07b"
    sha256 cellar: :any_skip_relocation, high_sierra:   "16c83b337e66de93f5e1b21d77242b849a4a1613e2c2e38d1971a77277924bce"
  end

  depends_on "gcc" # for gfortran

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

  test do
    (testpath/"test.r").write <<~EOS
      integer x,y
      x=1; y=2
      if(x == y)
              write(6,600)
      else if(x > y)
              write(6,601)
      else
              write(6,602)
      x=1
      while(x < 10){
        if(y != 2) break
        if(y != 2) next
        write(6,603)x
        x=x+1
        }
      repeat
        x=x-1
      until(x == 0)
      for(x=0; x < 10; x=x+1)
              write(6,604)x
      600 format('Wrong, x != y')
      601 format('Also wrong, x < y')
      602 format('Ok!')
      603 format('x = ',i2)
      604 format('x = ',i2)
      end
    EOS

    system "#{bin}/ratfor", "-o", "test.f", testpath/"test.r"
    system "gfortran", "test.f", "-o", "test"
    system "./test"
  end
end

{'fraction_non_alphanumeric': 0.1179805615550756, 'fraction_numerical': 0.18196544276457882, 'mean_word_length': 2.887722980062959, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, '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': '6913077', 'n_tokens_mistral': 1930, 'n_tokens_neox': 1574, 'n_words': 258}