<commit_before>require "mkmf"
require "fileutils"
require "tempfile"

unless find_executable("cmake")
  abort "ERROR: CMake is required to build couchbase extension."
end

def sys(*cmd)
  puts "-- #{Dir.pwd}"
  puts "-- #{cmd.join(" ")}"
  system(*cmd)
end

build_type = ENV["DEBUG"] ? "Debug" : "RelWithDebInfo"
cmake_flags = [
  "-DCMAKE_BUILD_TYPE=#{build_type}",
  "-DRUBY_HDR_DIR=#{RbConfig::CONFIG["rubyhdrdir"]}",
  "-DRUBY_ARCH_HDR_DIR=#{RbConfig::CONFIG["rubyarchhdrdir"]}",
  "-DTAOCPP_JSON_BUILD_TESTS=OFF",
  "-DTAOCPP_JSON_BUILD_EXAMPLES=OFF",
]
openssl_root = `brew --prefix openssl 2> /dev/null`.strip
unless openssl_root.empty?
  cmake_flags << "-DOPENSSL_ROOT_DIR=#{openssl_root}"<commit_msg>🔧 don't build snappy tests<commit_after>require "mkmf"
require "fileutils"
require "tempfile"

unless find_executable("cmake")
  abort "ERROR: CMake is required to build couchbase extension."
end

def sys(*cmd)
  puts "-- #{Dir.pwd}"
  puts "-- #{cmd.join(" ")}"
  system(*cmd)
end


build_type = ENV["DEBUG"] ? "Debug" : "RelWithDebInfo"
cmake_flags = [
  "-DCMAKE_BUILD_TYPE=#{build_type}",
  "-DRUBY_HDR_DIR=#{RbConfig::CONFIG["rubyhdrdir"]}",
  "-DRUBY_ARCH_HDR_DIR=#{RbConfig::CONFIG["rubyarchhdrdir"]}",
  "-DTAOCPP_JSON_BUILD_TESTS=OFF",
  "-DTAOCPP_JSON_BUILD_EXAMPLES=OFF",
  "-DSNAPPY_BUILD_TESTS=OFF",
  "-DSNAPPY_INSTALL=OFF",
]
openssl_root = `brew --prefix openssl 2> /dev/null`.strip
unless openssl_root.empty?
  cmake_flags << "-DOPENSSL_ROOT_DIR=#{openssl_root}"
{'fraction_non_alphanumeric': 0.17338709677419356, 'fraction_numerical': 0.0013440860215053765, 'mean_word_length': 6.09047619047619, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5724928', 'n_tokens_mistral': 604, 'n_tokens_neox': 585, 'n_words': 97}