<commit_before># frozen_string_literal: true

require 'chamber/context_resolver'

module  Chamber
class   Configuration
  attr_accessor :basepath,
                :decryption_keys,
                :encryption_keys,
                :files,
                :namespaces

  def initialize(options = {})
    options              = ContextResolver.resolve(options)

    self.basepath        = options.fetch(:basepath)
    self.namespaces      = options.fetch(:namespaces)
    self.decryption_keys = options.fetch(:decryption_keys)
    self.encryption_keys = options.fetch(:encryption_keys)
    self.files           = options.fetch(:files)
  end

  def to_hash
    {
      basepath:        basepath,
      decryption_keys: decryption_keys,
      encryption_keys: encryption_keys,
      files:           files,
      namespaces:      namespaces,
    }
  end<commit_msg>Add: Ability to Access rootpath From Chamber Configuration<commit_after># frozen_string_literal: true

require 'chamber/context_resolver'

module  Chamber
class   Configuration
  attr_accessor :basepath,
                :decryption_keys,
                :encryption_keys,
                :files,
                :namespaces,
                :rootpath

  def initialize(options = {})
    options              = ContextResolver.resolve(options)

    self.basepath        = options.fetch(:basepath)
    self.namespaces      = options.fetch(:namespaces)
    self.decryption_keys = options.fetch(:decryption_keys)
    self.encryption_keys = options.fetch(:encryption_keys)
    self.files           = options.fetch(:files)
    self.rootpath        = options.fetch(:rootpath)
  end

  def to_hash
    {
      basepath:        basepath,
      decryption_keys: decryption_keys,
      encryption_keys: encryption_keys,
      files:           files,
      namespaces:      namespaces,
    }
  end
{'fraction_non_alphanumeric': 0.07854821235102925, 'fraction_numerical': 0.0, 'mean_word_length': 2.234676007005254, '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': '333027', 'n_tokens_mistral': 521, 'n_tokens_neox': 511, 'n_words': 95}