<commit_before>require 'rbconfig'
require 'pathname'
require 'fileutils'

module Rbcalc
  def self.os
    @os ||= (
      host_os = RbConfig::CONFIG['host_os']
      case host_os
      when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
        :windows
      when /darwin|mac os/
        :macosx
      when /linux/
        :linux
      when /solaris|bsd/
        :unix
      else
        raise Error::WebDriverError, "unknown os: #{host_os.inspect}"
      end
    )
  end
  
  def self.home
    Pathname.new(__FILE__).dirname
  end
  
  def self.init!
    vpath = self.home.join('..','vendor','bcalc')
    # prepare library for linking
    case Rbcalc.os
    when :macosx
      # assign a new ID to the library os that xtools can get to id
      `/usr/bin/install_name_toolid #{vpath}/libbcalcdds.dylib vendor/bcalc/libbcalcdds.dylib`
    when :linux
      # ok
    else
      raise Error::WebDriverError, "Rbcalc cannot currently run on #{Rbcalc.os}"
    end
  end
end

Rbcalc.init!

require "rbcalc/version"
require "rbcalc/engine"
<commit_msg>on macosx, change the lib ID so that xtools can find it<commit_after>require 'rbconfig'
require 'pathname'
require 'fileutils'

module Rbcalc
  def self.os
    @os ||= (
      host_os = RbConfig::CONFIG['host_os']
      case host_os
      when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
        :windows
      when /darwin|mac os/
        :macosx
      when /linux/
        :linux
      when /solaris|bsd/
        :unix
      else
        raise Error::WebDriverError, "unknown os: #{host_os.inspect}"
      end
    )
  end
  
  def self.home
    Pathname.new(__FILE__).dirname
  end
  
  def self.init!
    vpath = self.home.join('..','vendor','bcalc')
    # prepare library for linking
    case Rbcalc.os
    when :macosx
      # assign a new ID to the library os that xtools can get to id
      `/usr/bin/install_name_tool -id #{vpath}/libbcalcdds.dylib vendor/bcalc/libbcalcdds.dylib`
    when :linux
      # ok
    else
      raise Error::WebDriverError, "Rbcalc cannot currently run on #{Rbcalc.os}"
    end
  end
end

Rbcalc.init!

require "rbcalc/version"
require "rbcalc/engine"

{'fraction_non_alphanumeric': 0.10516431924882629, 'fraction_numerical': 0.0, 'mean_word_length': 2.4594155844155843, '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': '52763', 'n_tokens_mistral': 768, 'n_tokens_neox': 757, 'n_words': 192}