Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.297.mcz==================== Summary ====================
Name: EToys-nice.297
Author: nice
Time: 26 April 2017, 11:12:27.059817 pm
UUID: b8866d63-4f7a-405c-b8a6-ae7a05c271a9
Ancestors: EToys-nice.296
Favour usage of the regular #findLastOccurrenceOfString:startingAt: over the (un-)deprecated #findLastOccuranceOfString:startingAt: BIS
=============== Diff against EToys-nice.296 ===============
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 findLastOccurrenceOfString: FileDirectory dot startingAt: 1.
- 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 > 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]]].
!