lib/liberty_buildpack/util/location_resolver.rb
def absolute_path(config_file, server_xml_dir)
      result = config_file.gsub(/(\$\{.+?\})/) do |match|
        if match =~ /\$\{env\./i
          var_name = match[6..-2]
          match = @env[var_name] unless @env[var_name].nil?
        else
          var_name = match[2..-2]
          match = @properties[var_name] unless @properties[var_name].nil?
        end
        match
      end
      result = File.expand_path(result, server_xml_dir)
      unless result.start_with?(@app_dir)
        raise "Absolute path must start with #{@app_dir} directory: #{result}"
      end
      result
    end
# Return the absolute path to the server configuration file.
Return the absolute path to the server configuration file.
Return the absolute path to the server configuration file .
def absolute_path(config_file, server_xml_dir)
      result = config_file.gsub(/(\$\{.+?\})/) do |match|
        if match =~ /\$\{env\./i
          var_name = match[6..-2]
          match = @env[var_name] unless @env[var_name].nil?
        else
          var_name = match[2..-2]
          match = @properties[var_name] unless @properties[var_name].nil?
        end
        match
      end
      result = File.expand_path(result, server_xml_dir)
      unless result.start_with?(@app_dir)
        raise "Absolute path must start with #{@app_dir} directory: #{result}"
      end
      result
    end
def absolute_path ( config_file , server_xml_dir ) result = config_file . gsub ( / ( \$ \{ .+? \} ) / ) do | match | if match =~ / \$ \{ env \. /i var_name = match [ 6 .. - 2 ] match = @env [ var_name ] unless @env [ var_name ] . nil? else var_name = match [ 2 .. - 2 ] match = @properties [ var_name ] unless @properties [ var_name ] . nil? end match end result = File . expand_path ( result , server_xml_dir ) unless result . start_with? ( @app_dir ) raise "Absolute path must start with #{@app_dir} directory: #{result}" end result end
Return the absolute path to the server configuration file.
Return the absolute path to the server configuration file .
config_file
server_xml_dir