lib/wmap/utils/url_magic.rb
# Convert a relative URL to an absolute one. For example, from URL base 'http://games.yahoo.com/' and file path '/game/the-magic-snowman-flash.html' => 'http://games.yahoo.com/game/the-magic-snowman-flash.html'
Convert a relative URL to an absolute one.
Convert a relative URL to an absolute one .
def make_absolute(base, relative_url)
    puts "Determine and return the absolute URL:\n Base: #{base}, Relative: #{relative_url} " if @verbose
		absolute_url = nil;
		if relative_url =~ /^\//
			absolute_url = create_absolute_url_from_base(base, relative_url)
		else
			absolute_url = create_absolute_url_from_context(base, relative_url)
		end
		puts "Found absolute URL: #{absolute_url}" if @verbose
		return absolute_url
  rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
    return nil
  end
def make_absolute ( base , relative_url ) puts "Determine and return the absolute URL:\n Base: #{base}, Relative: #{relative_url} " if @verbose absolute_url = nil ; if relative_url =~ / ^ \/ / absolute_url = create_absolute_url_from_base ( base , relative_url ) else absolute_url = create_absolute_url_from_context ( base , relative_url ) end puts "Found absolute URL: #{absolute_url}" if @verbose return absolute_url rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return nil end
Convert a relative URL to an absolute one.
Convert a relative URL to an absolute one .
base
<not_specific>
relative_url
<not_specific>