Am 29.04.2015 um 13:53 schrieb Sven Van Caekenberghe <sven@stfx.eu>:
Norbert,
On 29 Apr 2015, at 13:07, Norbert Hartl <norbert@hartl.name> wrote:
I'm not sure the behaviour of ZnUrl>>#closePath is the desired one.
'http://foo/a/b/c/' asZnUrl closePath
gives
It adds a slash if the #isSlash returns false. #isSlash indicated only the server root and not (what I was thinking) it returns true on trailing slash. IMHO #isSlash should be a test for trailing slash and #isRootPath should be a test for a non-existing or / path.
Norbert
#isSlash was/is intended to be what it is, but indeed #closePath could maybe be improved.
What about
closePath self isDirectoryPath ifFalse: [ self addPathSegment: #/ ]
?
Would that work for your use case ?
Sure. Didn't know about isDirectoryPath. Norbert