The Trunk: Files-eem.171.mcz

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

The Trunk: Files-eem.171.mcz

commits-2
Eliot Miranda uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-eem.171.mcz

==================== Summary ====================

Name: Files-eem.171
Author: eem
Time: 25 May 2017, 3:35:29.716969 pm
UUID: dbf98ee2-b593-4ede-b2de-0a188c125144
Ancestors: Files-nice.170

Fix case sensitivity in nextNameFor:extension:.  Harvested from Terf.

=============== Diff against Files-nice.170 ===============

Item was changed:
  ----- Method: FileDirectory>>nextNameFor:extension: (in category 'file name utilities') -----
  nextNameFor: baseFileName extension: extension
  "Assumes a file name includes a version number encoded as '.' followed by digits
  preceding the file extension.  Increment the version number and answer the new file name.
  If a version number is not found, set the version to 1 and answer a new file name"
 
  | files splits version |
 
  files := self fileNamesMatching: (baseFileName,'*', self class dot, extension).
  splits := files
  collect: [:file | self splitNameVersionExtensionFor: file]
+ thenSelect:
+ [:split |
+ self isCaseSensitive
+ ifTrue:[(split at: 1) = baseFileName]
+ ifFalse:[(split at: 1) match: baseFileName]].
+ version := splits isEmpty
+ ifTrue: [1]
+ ifFalse: [((splits detectMax: [ :each | each at: 2 ]) at: 2) + 1].
- thenSelect: [:split | (split at: 1) = baseFileName].
- splits isEmpty
- ifTrue: [version := 1]
- ifFalse: [version := ((splits detectMax: [ :each | each at: 2 ]) at: 2) + 1].
  ^ (baseFileName, '.', version asString, self class dot, extension) asFileName!