Method: Forge::Config#read
- Defined in:
- lib/forge/config.rb
#read ⇒ Object
Loads config declarations in user’s home dir
If file does not exist then it will be created
51 52 53 54 55 56 57 58 59 |
# File 'lib/forge/config.rb', line 51 def read return write unless File.exists?(self.config_file) data = File.open(self.config_file).read @config = data.empty? ? {} : JSON.parse(data) self end |