[squeak-dev] The Trunk: EToys-nice.296.mcz

Levente Uzonyi leves at caesar.elte.hu
Wed Apr 26 21:04:00 UTC 2017


You missed the other send a few lines above.

Levente

On Wed, 26 Apr 2017, commits at source.squeak.org wrote:

> Nicolas Cellier uploaded a new version of EToys to project The Trunk:
> http://source.squeak.org/trunk/EToys-nice.296.mcz
>
> ==================== Summary ====================
>
> Name: EToys-nice.296
> Author: nice
> Time: 26 April 2017, 10:58:40.211195 pm
> UUID: 5d6e88cb-95d4-4aea-87f1-3e8e97c96a1b
> Ancestors: EToys-ul.295
>
> Favour usage of the regular #findLastOccurrenceOfString:startingAt: over the (un-)deprecated #findLastOccuranceOfString:startingAt:
>
> =============== Diff against EToys-ul.295 ===============
>
> Item was changed:
>  ----- Method: FileList>>removeVersionNumberFromFileName (in category '*Etoys-Squeakland-file menu action') -----
>  removeVersionNumberFromFileName
>  	"The selected filename has a version number in it.  Rename the file  such that the version number is removed."
>
>  	| localName fullName dotPosition beforeDot earlierDotPosition within newLocalName |
>
>  	fullName := directory fullNameFor: fileName.
>  	localName := FileDirectory localNameFor: fullName.
>  	dotPosition := localName  findLastOccuranceOfString: FileDirectory dot  startingAt: 1.
>  	dotPosition > 0 ifTrue:
>  		[beforeDot := localName copyFrom: 1 to: dotPosition - 1.
> + 		earlierDotPosition := beforeDot findLastOccurrenceOfString: FileDirectory dot startingAt: 1.
> - 		earlierDotPosition := beforeDot findLastOccuranceOfString: FileDirectory dot startingAt: 1.
>  		earlierDotPosition > 0 ifTrue:
>  			[within := beforeDot copyFrom: (earlierDotPosition + 1) to: beforeDot size.
>  			(within size > 0 and: [within isAllDigits]) ifTrue:
>  				["whew"
>  				newLocalName := (localName copyFrom: 1 to: (earlierDotPosition - 1)),
>  					(localName copyFrom: dotPosition to: localName size).
>  				(directory fileNames includes: newLocalName)
>  					ifTrue:
>  						[(self confirm: ('do you want to clobber the existing' translated, '
>  ', newLocalName, '?') orCancel: [^ self]) ifFalse: [^ self].
>  						directory deleteFileNamed: localName].
>  				directory rename: localName toBe: newLocalName.
>  				self updateFileList]]].
>  !


More information about the Squeak-dev mailing list