Class: TraceTree::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/trace_tree/config.rb

Constant Summary collapse

DEFAULT =
{
  'pp_return_value' => []
}.freeze

Class Method Summary collapse

Class Method Details

.loadObject



11
12
13
14
15
16
17
18
19
# File 'lib/trace_tree/config.rb', line 11

def self.load
  config = DEFAULT
  custom = File.join ENV['HOME'], '.trace_tree_config'
  if File.exist?(custom) && (hash = YAML.load File.read custom)
    hash.select!{ |k, v| config.include? k }
    config = config.merge hash
  end
  OpenStruct.new config
end