Method: Forward::Config#write

Defined in:
lib/forward/config.rb

#writeObject

Write the current config data to ‘config_path’, and the current private_key to ‘key_path’.

Returns the Config object.



87
88
89
90
91
92
93
94
95
96
# File 'lib/forward/config.rb', line 87

def write
  Forward.logger.debug('[config] writing')

  File.open(config_path, 'w') { |f| f.write(YAML.dump(to_hash)) }

  self
rescue Exception => e
  Forward.logger.fatal "#{e.message}"
  raise ConfigError, 'Unable to write config file'
end