[FIX] NicerProjectFromUrl-bp ([er] round 2 looks better)

Frank Shearar Frank.Shearar at rnid.org.uk
Thu Feb 17 13:28:48 UTC 2005


bernhard at pieber.com <bernhard at pieber.com> wrote:
> 
> from preamble:
> 
> "Change Set:		NicerProjectFromUrl-bp
> Date:			13 February 2005
> Author:			Bernhard Pieber
> 
> Mantis# 0000861: Nasty code in Project class>fromUrl: and related
> methods
> http://bugs.impara.de/view.php?id=861
> 
> Not perfect, but better than before IMNSHO."!

I'd use "urlString asUrl" in preference to "Url absoluteFromText: urlString".

Hm, actually, Url class>>absoluteFromText: should really be Url class>>absoluteFromString:, shouldn't it? (or maybe #absoluteFrom: !) I mean, it takes a String parameter after all... anyway, that's not really a biggie. Maybe the parameter should be renamed to aStringOrText if that method can take Texts.

In ProjectLoading class>>bestAccessToFileName:andDirectory: how about doing

url isFile ifTrue: []

where Url>>isFileUrl is

isFileUrl
	^self scheme = self fileScheme.

and Url>>fileScheme is

fileScheme
	^'file'.

I wouldn't mind seeing some tests around the Project stuff. I won't supply them because I'm too ignorant :)

It looks good otherwise. Keep it up!

frank


*******************************************************************
This email and attachments (if any) must be swept for viruses before opening. Their contents may be confidential or privileged and are intended solely for the named recipient. If you are not the intended recipient and you have received this email in error you must not read or use this email and should notify RNID on: +44 (0) 20 7296 8282.

 

RNID, Registered Office 19-23 Featherstone Street, London EC1Y 8SL No. 454169 (England, Registered Charity No. 207720)

********************************************************************




More information about the Squeak-dev mailing list