lib/liberty_buildpack/util/location_resolver.rb
# 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.clone
      @properties.each do |symbol, mapping|
        variable = symbol.to_s.gsub "\_", '.'
        result.gsub! "\$\{#{variable}\}", mapping
      end
      result = File.expand_path(result, server_xml_dir)
      unless result.start_with?(@app_dir)
        fail "Absolute path must start with #{@app_dir} directory: #{result}"
      end
      result
    end
def absolute_path ( config_file , server_xml_dir ) result = config_file . clone @properties . each do | symbol , mapping | variable = symbol . to_s . gsub "\_" , '.' result . gsub! "\$\{#{variable}\}" , mapping end result = File . expand_path ( result , server_xml_dir ) unless result . start_with? ( @app_dir ) fail "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