lib/liberty_buildpack/util/configuration_utils.rb
def write(identifier, new_content, should_log = true)
          file = file_name(identifier)

          if file.exist?
            logger.debug { "Writing configuration file #{file}" } if should_log
            header = header(file)

            File.open(file, 'w') do |f|
              header.each { |line| f.write line }
              YAML.dump(new_content, f)
            end
          elsif should_log
            logger.debug { "No configuration file #{file} found" }
          end
        end
# Write a new configuration file to the buildpack configuration directory. Any existing file will be replaced.
#
# @param [String] identifier the identifier of the configuration to write
# @param [Boolean] should_log whether the contents of the configuration file should be logged.  This value
#                             should be left to its default and exists to allow the logger to use the utility.
Write a new configuration file to the buildpack configuration directory. Any existing file will be replaced.
Write a new configuration file to the buildpack configuration directory . Any existing file will be replaced .
def write(identifier, new_content, should_log = true)
          file = file_name(identifier)
          if file.exist?
            logger.debug { "Writing configuration file #{file}" } if should_log
            header = header(file)
            File.open(file, 'w') do |f|
              header.each { |line| f.write line }
              YAML.dump(new_content, f)
            end
          elsif should_log
            logger.debug { "No configuration file #{file} found" }
          end
        end
def write ( identifier , new_content , should_log = true ) file = file_name ( identifier ) if file . exist? logger . debug { "Writing configuration file #{file}" } if should_log header = header ( file ) File . open ( file , 'w' ) do | f | header . each { | line | f . write line } YAML . dump ( new_content , f ) end elsif should_log logger . debug { "No configuration file #{file} found" } end end
Write a new configuration file to the buildpack configuration directory.
Write a new configuration file to the buildpack configuration directory .
identifier
new_content
should_log
should_log whether the contents of the configuration file should be logged. This value should be left to its default and exists to allow the logger to use the utility.
should_log whether the contents of the configuration file should be logged . This value should be left to its default and exists to allow the logger to use the utility .