<commit_before>include (${SWIG_USE_FILE})
include(LibAddMacros)

find_package(Ruby)

if (NOT RUBY_FOUND)
  remove_binding(swig_ruby "ruby interpreter not found")
else()

	message(STATUS "Include Binding swig_ruby")

	add_headers (HDR_FILES)
	add_cppheaders (HDR_FILES)

	include_directories (${CMAKE_CURRENT_SOURCE_DIR})

  # minimal replacement for Ruby's mkmf.create_makefile
  execute_process (
          COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']" 
          OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR
  )

  include_directories(${RUBY_VENDOR_ARCH_DIR})
  include_directories(${RUBY_INCLUDE_DIRS})

  # just for debugging
  message (STATUS "Ruby executable: ${RUBY_EXECUTABLE}")
  message (STATUS "Ruby vendor arch dir: ${RUBY_VENDOR_ARCH_DIR}")
  message (STATUS "Ruby include path: ${RUBY_INCLUDE_PATH}")

	set_source_files_properties (kdb.i PROPERTIES CPLUSPLUS ON)
  #set_source_files_properties (kdb.i PROPERTIES SWIG_FLAGS "-py3;-extranative")
	
  set (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}")
	set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SWIG_OUTDIR}")
  set (CMAKE_SWIG_FLAGS "-O;-autorename;-DSWIG_NO_EXPORT_ITERATOR_METHODS;-v")

  swig_add_module (swig-ruby ruby kdb.i)
  swig_link_libraries (swig-ruby elektra-core elektra-kdb)
  set_target_properties (swig-ruby PROPERTIES OUTPUT_NAME kdb)
  
  set_source_files_properties (
          ${swig_generated_file_fullname} PROPERTIES 
          COMPILE_FLAGS "${SWIG_COMPILE_FLAGS} -Wno-unused-parameter -DSWIG_TYPE_TABLE=kdb"
  )

  #set (PYTHON_GET_MODULES_DIR_COMMAND "from distutils.sysconfig import get_python_lib; print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))")
	#execute_process (
	#	COMMAND ${PYTHON_EXECUTABLE} -c "${PYTHON_GET_MODULES_DIR_COMMAND}"
	#	OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
	#	OUTPUT_STRIP_TRAILING_WHITESPACE
	#)

	#install (
	#	FILES ${CMAKE_CURRENT_BINARY_DIR}/kdb.py
	#	DESTINATION ${PYTHON_SITE_PACKAGES}
	#)

	#install (
	#	TARGETS _swig-python
	#	LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
	#)

	include_directories (${CMAKE_CURRENT_SOURCE_DIR})
  #include_directories (${CMAKE_SOURCE_DIR}/src/swig/)

  add_subdirectory (tests)
endif()
<commit_msg>Ruby: ignore certain compiler warnings<commit_after>include (${SWIG_USE_FILE})
include(LibAddMacros)

find_package(Ruby)

if (NOT RUBY_FOUND)
  remove_binding(swig_ruby "ruby interpreter not found")
else()

	message(STATUS "Include Binding swig_ruby")

	add_headers (HDR_FILES)
	add_cppheaders (HDR_FILES)

	include_directories (${CMAKE_CURRENT_SOURCE_DIR})

  # minimal replacement for Ruby's mkmf.create_makefile
  execute_process (
          COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']" 
          OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR
  )

  include_directories(${RUBY_VENDOR_ARCH_DIR})
  include_directories(${RUBY_INCLUDE_DIRS})

  # just for debugging
  message (STATUS "Ruby executable: ${RUBY_EXECUTABLE}")
  message (STATUS "Ruby vendor arch dir: ${RUBY_VENDOR_ARCH_DIR}")
  message (STATUS "Ruby include path: ${RUBY_INCLUDE_PATH}")

	set_source_files_properties (kdb.i PROPERTIES CPLUSPLUS ON)
  #set_source_files_properties (kdb.i PROPERTIES SWIG_FLAGS "-py3;-extranative")
	
  set (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}")
	set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SWIG_OUTDIR}")
  set (CMAKE_SWIG_FLAGS "-O;-autorename;-DSWIG_NO_EXPORT_ITERATOR_METHODS;-v")

  swig_add_module (swig-ruby ruby kdb.i)
  swig_link_libraries (swig-ruby elektra-core elektra-kdb)
  set_target_properties (swig-ruby PROPERTIES OUTPUT_NAME kdb)
  
  set_source_files_properties (
          ${swig_generated_file_fullname} PROPERTIES 
          COMPILE_FLAGS "${SWIG_COMPILE_FLAGS} -Wno-unused-parameter -Wno-unused-but-set-variable -DSWIG_TYPE_TABLE=kdb"
  )

  #set (PYTHON_GET_MODULES_DIR_COMMAND "from distutils.sysconfig import get_python_lib; print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))")
	#execute_process (
	#	COMMAND ${PYTHON_EXECUTABLE} -c "${PYTHON_GET_MODULES_DIR_COMMAND}"
	#	OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
	#	OUTPUT_STRIP_TRAILING_WHITESPACE
	#)

	#install (
	#	FILES ${CMAKE_CURRENT_BINARY_DIR}/kdb.py
	#	DESTINATION ${PYTHON_SITE_PACKAGES}
	#)

	#install (
	#	TARGETS _swig-python
	#	LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
	#)

	include_directories (${CMAKE_CURRENT_SOURCE_DIR})
  #include_directories (${CMAKE_SOURCE_DIR}/src/swig/)

  add_subdirectory (tests)
endif()

{'fraction_non_alphanumeric': 0.10273665320771647, 'fraction_numerical': 0.00044863167339614175, 'mean_word_length': 6.157303370786517, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5200903', 'n_tokens_mistral': 1811, 'n_tokens_neox': 1703, 'n_words': 273}