<commit_before>require 'volt/volt/environment'
require 'volt/extra_core/extra_core'
require 'volt/reactive/computation'
require 'volt/reactive/dependency'
require 'volt/utils/modes'
require 'volt/utils/volt_user_error'
require 'volt/utils/boolean_patch'

require 'volt/config'
unless RUBY_PLATFORM == 'opal'
  require 'volt/data_stores/data_store'
end
require 'volt/volt/users'

module Volt
  @in_browser = if RUBY_PLATFORM == 'opal'
                  `!!document && !window.OPAL_SPEC_PHANTOM`
                else
                  false
                end

  include Modes

  class << self
    def root
      @root ||= File.expand_path(Dir.pwd)
    end

    attr_writer :root

    def server?
      !!ENV['SERVER']
    end

    def client?
      !ENV['SERVER']
    end

    def source_maps?
      !!ENV['MAPS']
    end

    def env
      @env ||= Volt::Environment.new
    end

    def logger<commit_msg>Show exception when calling Volt.root from the client.<commit_after>require 'volt/volt/environment'
require 'volt/extra_core/extra_core'
require 'volt/reactive/computation'
require 'volt/reactive/dependency'
require 'volt/utils/modes'
require 'volt/utils/volt_user_error'
require 'volt/utils/boolean_patch'

require 'volt/config'
unless RUBY_PLATFORM == 'opal'
  require 'volt/data_stores/data_store'
end
require 'volt/volt/users'

module Volt
  @in_browser = if RUBY_PLATFORM == 'opal'
                  `!!document && !window.OPAL_SPEC_PHANTOM`
                else
                  false
                end

  include Modes

  class << self
    def root
      if self.client?
        raise "Volt.root can not be called from the client."
      end
      @root ||= File.expand_path(Dir.pwd)
    end

    attr_writer :root

    def server?
      !!ENV['SERVER']
    end

    def client?
      !ENV['SERVER']
    end

    def source_maps?
      !!ENV['MAPS']
    end

    def env
      @env ||= Volt::Environment.new
    end

    def logger
{'fraction_non_alphanumeric': 0.10472279260780287, 'fraction_numerical': 0.0, 'mean_word_length': 2.4741532976827094, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4636655', 'n_tokens_mistral': 659, 'n_tokens_neox': 614, 'n_words': 148}