On Tue, Mar 2, 2010 at 12:03 PM, Lukas Renggli <
renggli@gmail.com> wrote:
>> I only wanted to keep the the original package and don't use any dash
>> in the package name. Of course we can use your way.
>
> Aha ok, then this is fine of course. I don't care about the dashes.
>
> Lukas
>
>>
>> Cheers,
>> -- Pavel
>>
>> On Tue, Mar 2, 2010 at 11:50 AM, Lukas Renggli <
renggli@gmail.com> wrote:
>>>> SystemOrganization renameCategory: 'Announcements-Core' toBe: 'Announcements'.
>>>> SystemOrganization renameCategory: 'Announcements-View' toBe:
>>>> 'AnnouncementsView'.
>>>
>>> Why can't this just be split into two packages 'Announcements-Core'
>>> and 'Announcements-View'?
>>>
>>> Furthermore, the code above looses all extension methods. For example
>>> 'Announcements-View' extends 'Announcement-Core' in the class
>>> Announcement. Maybe it would be safer to rename packages using the
>>> code we use in Seaside:
>>>
>>> renamePackage: oldPackageName to: newPackageName
>>> � � � �"self renamePackage: 'Seaside-Squeak-Development-Core' to:
>>> 'Seaside-Pharo-Development-Core'"
>>>
>>> � � � �| oldPackage newPackage oldWorkingCopy newWorkingCopy |
>>> � � � �oldPackage := PackageInfo named: oldPackageName.
>>> � � � �newPackage := PackageInfo named: newPackageName.
>>>
>>> � � � �" rename system categories "
>>> � � � �oldPackage systemCategories do: [ :oldCategory |
>>> � � � � � � � �| newCategory |
>>> � � � � � � � �newCategory := oldCategory allButFirst: oldPackage systemCategoryPrefix size.
>>> � � � � � � � �Smalltalk organization renameCategory: oldCategory toBe: newPackage
>>> systemCategoryPrefix , newCategory ].
>>>
>>> � � � �" rename method categories "
>>> � � � �oldPackage extensionClasses do: [ :extensionClass |
>>> � � � � � � � �(oldPackage extensionCategoriesForClass: extensionClass) do: [ :oldProtocol |
>>> � � � � � � � � � � � �| newProtocol |
>>> � � � � � � � � � � � �newProtocol := oldProtocol allButFirst: oldPackage methodCategoryPrefix size.
>>> � � � � � � � � � � � �extensionClass organization renameCategory: oldProtocol toBe:
>>> newPackage methodCategoryPrefix , newProtocol ] ].
>>>
>>> � � � �" update monticello packages "
>>> � � � �oldWorkingCopy := MCWorkingCopy forPackage: (MCPackage named: oldPackageName).
>>> � � � �newWorkingCopy := MCWorkingCopy forPackage: (MCPackage named: newPackageName).
>>> � � � �newWorkingCopy repositoryGroup: oldWorkingCopy repositoryGroup; modified: true.
>>>
>>> � � � �" test is all methos have been caught "
>>> � � � �oldPackage methods isEmpty
>>> � � � � � � � �ifTrue: [ oldWorkingCopy unload. PackageOrganizer default
>>> unregisterPackage: oldPackage ]
>>> � � � � � � � �ifFalse: [ self error: 'Some code entities remain in the old
>>> package, please migrate manually.' ]
>>>
>>> Otherwise, I completely agree with the proposed refactorings :-)
>>>
>>> Lukas
>>>
>>> --
>>> Lukas Renggli
>>>
http://www.lukas-renggli.ch
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>>
Pharo-project@lists.gforge.inria.fr
>>>
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>>
Pharo-project@lists.gforge.inria.fr
>>
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Lukas Renggli
>
http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
>
Pharo-project@lists.gforge.inria.fr
>
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project