<commit_before>require 'pathname'
require 'socket'
require 'hashie/mash'
require 'chamber/decryption_key'

module  Chamber
class   ContextResolver
  def initialize(options = {})
    self.options = Hashie::Mash.new(options)
  end

  # rubocop:disable Metrics/AbcSize
  def resolve
    options[:rootpath]       ||= Pathname.pwd
    options[:rootpath]         = Pathname.new(options[:rootpath])
    options[:encryption_key]   = resolve_encryption_key(options[:encryption_key])
    options[:decryption_key]   = resolve_decryption_key(options[:decryption_key])
    options[:namespaces]     ||= []
    options[:preset]         ||= resolve_preset

    if options[:preset] == 'rails'
      options[:basepath]     ||= options[:rootpath] + 'config'

      if options[:namespaces] == []
        require options[:rootpath].join('config', 'application')

        options[:namespaces]   = [<commit_msg>Fixed: Pathname implicit conversion to string in Ruby 2.2.1<commit_after>require 'pathname'
require 'socket'
require 'hashie/mash'
require 'chamber/decryption_key'

module  Chamber
class   ContextResolver
  def initialize(options = {})
    self.options = Hashie::Mash.new(options)
  end

  # rubocop:disable Metrics/AbcSize
  def resolve
    options[:rootpath]       ||= Pathname.pwd
    options[:rootpath]         = Pathname.new(options[:rootpath])
    options[:encryption_key]   = resolve_encryption_key(options[:encryption_key])
    options[:decryption_key]   = resolve_decryption_key(options[:decryption_key])
    options[:namespaces]     ||= []
    options[:preset]         ||= resolve_preset

    if options[:preset] == 'rails'
      options[:basepath]     ||= options[:rootpath] + 'config'

      if options[:namespaces] == []
        require options[:rootpath].join('config', 'application').to_s

        options[:namespaces]   = [
{'fraction_non_alphanumeric': 0.1324575807334428, 'fraction_numerical': 0.0016420361247947454, 'mean_word_length': 3.8877005347593583, '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': '3928298', 'n_tokens_mistral': 565, 'n_tokens_neox': 556, 'n_words': 96}