Chris Muller uploaded a new version of PackageInfo-Base to project The Trunk:
http://source.squeak.org/trunk/PackageInfo-Base-cmm.50.mcz==================== Summary ====================
Name: PackageInfo-Base-cmm.50
Author: cmm
Time: 12 January 2011, 12:31:39.136 pm
UUID: 183d9a60-d894-44c8-8b24-0f4cc92a2209
Ancestors: PackageInfo-Base-cmm.49
- Don't lose PackageInfo state when replacing with a subclass.
- No need to double-register replacement PackageInfo's.
- Simplified comment.
=============== Diff against PackageInfo-Base-cmm.49 ===============
Item was changed:
----- Method: PackageInfo class>>named: (in category 'packages access') -----
named: aString
+ "Answer the PackageInfo with name aString."
+ | original replacement |
+ original := PackageOrganizer default
- "Alternative to #named: that provides allows you to register your own
- PackageInfo subclasses."
- | firstTry |
- firstTry := PackageOrganizer default
packageNamed: aString
+ ifAbsent: [].
+ ^ (original isNil
+ or: [original class
- ifAbsent: [nil].
- ^ (firstTry isNil
- or: [firstTry class
~= (self classFor: aString)])
+ ifTrue: [replacement := self newNamed: aString.
+ original
+ ifNotNil: [replacement copySameFrom: original].
+ replacement register]
+ ifFalse: [original]!
- ifTrue: [(self newNamed: aString) register]
- ifFalse: [firstTry]!
Item was changed:
----- Method: PackageInfo class>>newNamed: (in category 'private') -----
newNamed: aString
^ (self classFor: aString) new packageName: aString;
- register;
yourself!