Class: GlobalConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/yesman/global_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGlobalConfig

Returns a new instance of GlobalConfig.



5
6
7
8
# File 'lib/yesman/global_config.rb', line 5

def initialize
  @pre_existing = false
  @global_config_path =  "#{Dir.home}/.yesman"
end

Instance Attribute Details

#global_config_pathObject (readonly)

Returns the value of attribute global_config_path.



3
4
5
# File 'lib/yesman/global_config.rb', line 3

def global_config_path
  @global_config_path
end

#pre_existingObject (readonly)

Returns the value of attribute pre_existing.



2
3
4
# File 'lib/yesman/global_config.rb', line 2

def pre_existing
  @pre_existing
end

Instance Method Details

#loadObject



10
11
12
13
14
15
16
17
18
# File 'lib/yesman/global_config.rb', line 10

def load
  ensure_config_dir

  if !pre_existing
    puts "Copying file templates to #{global_config_path}" 
    copy_templates
    create_global_config
  end
end