Class: GlobalConfig
- Inherits:
-
Object
- Object
- GlobalConfig
- Defined in:
- lib/yesman/global_config.rb
Instance Attribute Summary collapse
-
#global_config_path ⇒ Object
readonly
Returns the value of attribute global_config_path.
-
#pre_existing ⇒ Object
readonly
Returns the value of attribute pre_existing.
Instance Method Summary collapse
-
#initialize ⇒ GlobalConfig
constructor
A new instance of GlobalConfig.
- #load ⇒ Object
Constructor Details
#initialize ⇒ GlobalConfig
Returns a new instance of GlobalConfig.
8 9 10 11 |
# File 'lib/yesman/global_config.rb', line 8 def initialize @pre_existing = false @global_config_path = "#{Dir.home}/.yesman" end |
Instance Attribute Details
#global_config_path ⇒ Object (readonly)
Returns the value of attribute global_config_path.
6 7 8 |
# File 'lib/yesman/global_config.rb', line 6 def global_config_path @global_config_path end |
#pre_existing ⇒ Object (readonly)
Returns the value of attribute pre_existing.
5 6 7 |
# File 'lib/yesman/global_config.rb', line 5 def pre_existing @pre_existing end |
Instance Method Details
#load ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/yesman/global_config.rb', line 13 def load ensure_config_dir if !pre_existing puts "Copying file templates to #{global_config_path}" copy_all elsif old_version? FileUtil.clear_directory global_config_path copy_all end end |