Class: GitTree::Config

Inherits:
Anyway::Config
  • Object
show all
Defined in:
lib/util/config.rb

Overview

Centralized configuration for the git-tree gem. Uses anyway_config to load settings from:

  1. A YAML file at ~/.treeconfig.yml
  2. Environment variables (e.g., GIT_TREE_GIT_TIMEOUT)
  3. Default values defined here.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Config

Override initialize to set defaults for nil values after loading.



23
24
25
26
27
28
# File 'lib/util/config.rb', line 23

def initialize(*)
  super
  self.git_timeout   ||= 300
  self.verbosity     ||= ::Logging::NORMAL
  self.default_roots ||= %w[sites sitesUbuntu work]
end

Class Method Details

.default_config_path ⇒ Object

The location of the user's config file.



15
16
17
# File 'lib/util/config.rb', line 15

def self.default_config_path
  File.expand_path('~/.treeconfig.yml')
end