[squeak-dev] The Trunk: Monticello-cmm.479.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Aug 16 02:51:28 UTC 2011
Chris Muller uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-cmm.479.mcz
==================== Summary ====================
Name: Monticello-cmm.479
Author: cmm
Time: 14 August 2011, 2:06:47.864 pm
UUID: 1499439c-568d-41be-98f6-6306b29113f9
Ancestors: Monticello-cmm.478
Don't need to use #indexSatisfying:startingAt:.
=============== Diff against Monticello-cmm.478 ===============
Item was changed:
----- Method: String>>withLoadedPackageVersions (in category '*monticello') -----
withLoadedPackageVersions
"Everywhere the receiver contains a package version in the format: PackageName-author.123 for which a version of that package is loaded in the image, answer a new String with each of those package versions changed to reflect the currently loaded version."
| string |
string := self.
MCWorkingCopy allManagers do:
[ : eachWorkingCopy | | start packageName |
start := 1.
packageName := eachWorkingCopy packageName.
[ start := string
findString: packageName
startingAt: start.
start > 0 and: [ string size > (start + packageName size + 4) ] ] whileTrue:
[ | dot end versionName |
dot := string
indexOf: $.
startingAt: (end := start + packageName size)
ifAbsent: [ 0 ].
dot > 0 ifTrue:
+ [ end := (dot + 1 to: string size)
+ detect: [ : n | (string at: n) isDigit not ]
+ ifNone: [ 0 ].
- [ end := string
- indexSatisfying:
- [ : each | each isDigit not ]
- startingAt: dot + 1.
(end > (dot + 1) and:
[ (dot + 1 to: end - 1) allSatisfy:
[ : n | (string at: n) isDigit ] ])
ifTrue:
[ versionName := string
copyFrom: start
to: end - 1.
versionName asMCVersionName packageName = packageName ifTrue:
[ string := string
copyReplaceTokens: versionName
with: eachWorkingCopy ancestors first name ] ]
ifFalse: [ end := start + packageName size ] ].
start := end ] ].
^ string!
More information about the Squeak-dev
mailing list
|