<commit_before>require 'rbconfig'

module Celluloid
  module CPUCounter
    case RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
    when 'darwin'
      @cores = Integer(`sysctl hw.ncpu`[/\d+/])
    when 'linux'
      @cores = if File.exists?("/sys/devices/system/cpu/present")
        File.read("/sys/devices/system/cpu/present").split('-').last.to_i+1
      else
        Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count<commit_msg>Specify full path for sysctl on darwin hosts<commit_after>require 'rbconfig'

module Celluloid
  module CPUCounter
    case RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
    when 'darwin'
      @cores = Integer(`/usr/sbin/sysctl hw.ncpu`[/\d+/])
    when 'linux'
      @cores = if File.exists?("/sys/devices/system/cpu/present")
        File.read("/sys/devices/system/cpu/present").split('-').last.to_i+1
      else
        Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count
{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.0021390374331550803, 'mean_word_length': 3.087336244541485, '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': '7459284', 'n_tokens_mistral': 353, 'n_tokens_neox': 338, 'n_words': 54}