[BUG] Url documentation bug

David N. Smith (IBM) dnsmith at watson.ibm.com
Thu Mar 7 21:34:32 UTC 2002


While it works OK, the documentation for Url>>#newFromRelativeText: omits some critical details. The current method comment is:

"return a URL relative to the current one, given by aString.  For instance, if self is 'http://host/dir/file', and aString is '/dir2/file2', then the return will be a Url for 'http://host/dir2/file2'"

It fails to point out other interesting variants. First in each example is the expression, then the result it produces.

As documented:
	'http://PBG3/x/html/short.html' asUrl newFromRelativeText: '/banana/bread.html' 
 	http://PBG3/banana/bread.html

Up the hierarchy from the current URL path (note the two dots); works with multiple sets of dots too:
	'http://PBG3/x/html/short.html' asUrl newFromRelativeText: '../banana/bread.html' 
	http://PBG3/x/banana/bread.html

Relative to the current URL path:
	'http://PBG3/x/html/short.html' asUrl newFromRelativeText: 'banana/bread.html'  
	http://PBG3/x/html/banana/bread.html

Attached is a fileout of #newFromRelativeText: with a revised comment.

Dave
-------------- next part --------------
Skipped content of type multipart/appledouble


More information about the Squeak-dev mailing list