lib/helpers/mazi_config.rb
# saves the changes on the current configuration file
saves the changes on the current configuration file
saves the changes on the current configuration file
def writeConfigFile(conf=nil, file='/etc/mazi/config.yml')
    @config = conf.nil? ? readConfigFile : conf
    File.open(file, 'w+') { |f| YAML.dump(@config, f) }
    f = File.open(file, "r+")
      lines = f.readlines
    f.close
    str = TOPCOMMENTS
    lines.each  { |line| str += line }
    output = File.new(file, "w")
      output.write str
    output.close
    @config
  end
def writeConfigFile ( conf = nil , file = '/etc/mazi/config.yml' ) @config = conf . nil? ? readConfigFile : conf File . open ( file , 'w+' ) { | f | YAML . dump ( @config , f ) } f = File . open ( file , "r+" ) lines = f . readlines f . close str = TOPCOMMENTS lines . each { | line | str += line } output = File . new ( file , "w" ) output . write str output . close @config end
saves the changes on the current configuration file
saves the changes on the current configuration file
conf
<not_specific>
file
<not_specific>