<commit_before>class Re2 < Formula
  desc "Alternative to backtracking PCRE-style regular expression engines"
  homepage "https://github.com/google/re2"
  url "https://github.com/google/re2/archive/2017-07-01.tar.gz"
  version "20170701"
  sha256 "e6f06ad87cdacbf4b5573481de78f0de609d6e9227028c80cae813751d834b1e"
  head "https://github.com/google/re2.git"

  bottle do
    cellar :any
    sha256 "13ff3f99c3cb1cccc2329edd26c2fa5acb8907e0d54afb584a84a1459b237ea3" => :sierra
    sha256 "01d61b9a2309853508e84da8f38b54c2cdd917e648b19a82161f3bf188717278" => :el_capitan
    sha256 "239493d25d1b65a3bed144182465ccebe4405a8612612188ac45ff0a56b92443" => :yosemite
  end

  needs :cxx11

  def install
    ENV.cxx11

    system "make", "install", "prefix=#{prefix}"
    MachO::Tools.change_dylib_id("#{lib}/libre2.0.0.0.dylib", "#{lib}/libre2.0.dylib") if OS.mac?
    ext = OS.mac? ? "dylib" : "so"
    lib.install_symlink "libre2.0.0.0.#{ext}" => "libre2.0.#{ext}"
    lib.install_symlink "libre2.0.0.0.#{ext}" => "libre2.#{ext}"
  end

  test do
    (testpath/"test.cpp").write <<-EOS.undent
      #include <re2/re2.h>
      #include <assert.h>
      int main() {
        assert(!RE2::FullMatch("hello", "e"));
        assert(RE2::PartialMatch("hello", "e"));
        return 0;
      }
    EOS
    system ENV.cxx, "-std=c++11", "-I#{include}", "-L#{lib}", "-lre2",
           "test.cpp", "-o", "test"
    system "./test"
  end
end<commit_msg>re2: update 20170701 bottle for Linuxbrew.<commit_after>class Re2 < Formula
  desc "Alternative to backtracking PCRE-style regular expression engines"
  homepage "https://github.com/google/re2"
  url "https://github.com/google/re2/archive/2017-07-01.tar.gz"
  version "20170701"
  sha256 "e6f06ad87cdacbf4b5573481de78f0de609d6e9227028c80cae813751d834b1e"
  head "https://github.com/google/re2.git"

  bottle do
    cellar :any
    sha256 "13ff3f99c3cb1cccc2329edd26c2fa5acb8907e0d54afb584a84a1459b237ea3" => :sierra
    sha256 "01d61b9a2309853508e84da8f38b54c2cdd917e648b19a82161f3bf188717278" => :el_capitan
    sha256 "239493d25d1b65a3bed144182465ccebe4405a8612612188ac45ff0a56b92443" => :yosemite
    sha256 "c94a4b0cee3a91643db9c4fc0f13de9b77abb05d6d3473bd089caa496b1a6971" => :x86_64_linux
  end

  needs :cxx11

  def install
    ENV.cxx11

    system "make", "install", "prefix=#{prefix}"
    MachO::Tools.change_dylib_id("#{lib}/libre2.0.0.0.dylib", "#{lib}/libre2.0.dylib") if OS.mac?
    ext = OS.mac? ? "dylib" : "so"
    lib.install_symlink "libre2.0.0.0.#{ext}" => "libre2.0.#{ext}"
    lib.install_symlink "libre2.0.0.0.#{ext}" => "libre2.#{ext}"
  end

  test do
    (testpath/"test.cpp").write <<-EOS.undent
      #include <re2/re2.h>
      #include <assert.h>
      int main() {
        assert(!RE2::FullMatch("hello", "e"));
        assert(RE2::PartialMatch("hello", "e"));
        return 0;
      }
    EOS
    system ENV.cxx, "-std=c++11",
           "test.cpp", "-I#{include}", "-L#{lib}", "-pthread", "-lre2", "-o", "test"
    system "./test"
  end
end
{'fraction_non_alphanumeric': 0.1596945551128818, 'fraction_numerical': 0.16733067729083664, 'mean_word_length': 3.729984301412873, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 18, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '4574593', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1326, 'n_words': 186}