<commit_before># frozen_string_literal: true
# encoding: utf-8

require 'singleton'

class SpecConfig
  include Singleton

  def initialize
    if ENV['MONGODB_URI']
      @uri_str = ENV['MONGODB_URI']
      @uri = Mongo::URI.new(@uri_str)
    end
  end

  attr_reader :uri_str
  attr_reader :uri

  def addresses
    if @uri
      @uri.servers
    else
      ['127.0.0.1']
    end
  end

  def mri?
    !jruby?
  end

  def jruby?
    RUBY_PLATFORM =~ /\bjava\b/
  end

  def platform
    RUBY_PLATFORM
  end

  def client_debug?
    %w(1 true yes).include?(ENV['CLIENT_DEBUG']&.downcase)
  end

  def app_tests?
    %w(1 true yes).include?(ENV['APP_TESTS']&.downcase)
  end

  def ci?
    !!ENV['CI']
  end
end
<commit_msg>MONGOID-4924 change default host to have port (#4816)<commit_after># frozen_string_literal: true
# encoding: utf-8

require 'singleton'

class SpecConfig
  include Singleton

  def initialize
    if ENV['MONGODB_URI']
      @uri_str = ENV['MONGODB_URI']
      @uri = Mongo::URI.new(@uri_str)
    end
  end

  attr_reader :uri_str
  attr_reader :uri

  def addresses
    if @uri
      @uri.servers
    else
      ['127.0.0.1:27017']
    end
  end

  def mri?
    !jruby?
  end

  def jruby?
    RUBY_PLATFORM =~ /\bjava\b/
  end

  def platform
    RUBY_PLATFORM
  end

  def client_debug?
    %w(1 true yes).include?(ENV['CLIENT_DEBUG']&.downcase)
  end

  def app_tests?
    %w(1 true yes).include?(ENV['APP_TESTS']&.downcase)
  end

  def ci?
    !!ENV['CI']
  end
end

{'fraction_non_alphanumeric': 0.11697860962566844, 'fraction_numerical': 0.02072192513368984, 'mean_word_length': 2.678132678132678, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1851706', 'n_tokens_mistral': 630, 'n_tokens_neox': 593, 'n_words': 135}