lib/liberty_buildpack/util/configuration_utils.rb
def merge_configuration(configuration, user_provided_value, var_name, should_log)
          if user_provided_value.is_a?(Hash)
            configuration = do_merge(configuration, user_provided_value, should_log)
          elsif user_provided_value.is_a?(Array)
            user_provided_value.each { |new_prop| configuration = do_merge(configuration, new_prop, should_log) }
          else
            raise "User configuration value in environment variable #{var_name} is not valid: #{user_provided_value}"
          end
          configuration
        end
# Loads a configuration file from the buildpack configuration directory.  If the configuration file does not
# exist, returns an empty hash. Overlays configuration in a matching environment variable, on top of the loaded
# configuration, if present. Will not add a new configuration key where an existing one does not exist.
#
# @param [String] identifier the identifier of the configuration to load
# @param [Boolean] clean_nil_values whether empty/nil values should be removed along with their keys from the
#                                  returned configuration.
# @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.
# @return [Hash] the configuration or an empty hash if the configuration file does not exist
Loads a configuration file from the buildpack configuration directory.  If the configuration file does not
exist, returns an empty hash. Overlays configuration in a matching environment variable, on top of the loaded
configuration, if present. Will not add a new configuration key where an existing one does not exist.
Loads a configuration file from the buildpack configuration directory . If the configuration file does not exist returns an empty hash . Overlays configuration in a matching environment variable on top of the loaded configuration if present . Will not add a new configuration key where an existing one does not exist .
def merge_configuration(configuration, user_provided_value, var_name, should_log)
          if user_provided_value.is_a?(Hash)
            configuration = do_merge(configuration, user_provided_value, should_log)
          elsif user_provided_value.is_a?(Array)
            user_provided_value.each { |new_prop| configuration = do_merge(configuration, new_prop, should_log) }
          else
            raise "User configuration value in environment variable #{var_name} is not valid: #{user_provided_value}"
          end
          configuration
        end
def merge_configuration ( configuration , user_provided_value , var_name , should_log ) if user_provided_value . is_a? ( Hash ) configuration = do_merge ( configuration , user_provided_value , should_log ) elsif user_provided_value . is_a? ( Array ) user_provided_value . each { | new_prop | configuration = do_merge ( configuration , new_prop , should_log ) } else raise "User configuration value in environment variable #{var_name} is not valid: #{user_provided_value}" end configuration end
Loads a configuration file from the buildpack configuration directory.
Loads a configuration file from the buildpack configuration directory .
the configuration or an empty hash if the configuration file does not exist
the configuration or an empty hash if the configuration file does not exist
Hash
configuration
user_provided_value
var_name
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 .