def store_value!(key, value, comment = nil)
      pattern = /\A#{ key }:.*\Z/
      new_line = "#{ key }: #{ value }"
      new_line += " # #{ comment }" if comment

      content = File.readlines(path).map do |line|
        line.rstrip.sub pattern, new_line
      end.join("\n") + "\n"

      File.write path, content
    end
def store_value!(key, value, comment = nil)
      pattern = /\A#{ key }:.*\Z/
      new_line = "#{ key }: #{ value }"
      new_line += " # #{ comment }" if comment

      content = File.readlines(path).map do |line|
        line.rstrip.sub pattern, new_line
      end.join("\n") + "\n"

      File.write path, content
    end
Initialize the configuration object from a YAML file

 @param config_file [String] path to the configuration file
 Store a key-value pair in the configuration file with an optional comment.
 Try to preserve the comments and the indentation of the file.
 We assume the configuration file already features the given key.

 @param key [String] key
 @param value [String] value to store for given key
 @param comment [String] optional comment