The Trunk: EToys-nice.296.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: EToys-nice.296.mcz

commits-2
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]]].
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: EToys-nice.296.mcz

Levente Uzonyi
You missed the other send a few lines above.

Levente

On Wed, 26 Apr 2017, [hidden email] 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]]].
>  !

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: EToys-nice.296.mcz

Nicolas Cellier
Oh! How can I have missed that? Thanks!

2017-04-26 23:04 GMT+02:00 Levente Uzonyi <[hidden email]>:
You missed the other send a few lines above.

Levente


On Wed, 26 Apr 2017, [hidden email] 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]]].
 !