dmacqueen wrote:We need to go back and resurrect some code from an older mgr*.dat file. I want to search for classes or apps that were changed by 'hjohnson'.
I want to do something like this: Envy allApplications select: [:each | each developer = 'hjohnson'], but I can't figure out how to do it.
Thanks,
Donald [|]
Here is some code - as an example - but it's not what you really want. Find all loaded applications, where a special user name is a group member ....
Therefore you may specify, what "developer" means in your case .... that's not really that clear ...
- Code: Select all
SubApplication currentlyLoaded select: [ :anApplication |
(anApplication groupMembers
detect: [ :eachEMUser | eachEMUser fullName = 'Marten Feldtmann' ] ifNone: [ nil ]) notNil ]
2.nd attempt - now we look for changed classes in all loaded applications:
- Code: Select all
| emUserWanted |
emUserWanted := EmUser named: 'Marten Feldtmann'.
Transcript cr ; show: 'Searching for applications changed by <',emUserWanted fullName,'>'.
SubApplication currentlyLoaded do: [ :eachApplication |
| allChangedClasses |
allChangedClasses := eachApplication classes select: [ :eachClass | (eachClass developerIn: eachApplication) = emUserWanted ].
allChangedClasses notEmpty ifTrue:[
Transcript cr ; show: 'Application <',eachApplication name,'> changed by <',emUserWanted fullName,'>'.
allChangedClasses do: [ :eachClass | Transcript cr ; show: 'Class <',eachClass name,'> in <',eachApplication name,'> changed by <',emUserWanted fullName,'>' ].
]
].
... and with the help from Adrian (following post) one gets:
- Code: Select all
emUserWanted := EmUser named: 'Marten Feldtmann'.
Transcript cr ; show: 'Searching for applications changed by <',emUserWanted fullName,'>'.
Application allNames do: [:name |
(Application shadowsFor: name asString) do:[:eachApplication |
| allChangedClasses |
allChangedClasses := eachApplication classes select: [ :eachClass | (eachClass developerIn: eachApplication) = emUserWanted ].
allChangedClasses notEmpty ifTrue:[
Transcript cr ; show: 'Application <',eachApplication name,'> (',eachApplication versionName asString,') changed by <',emUserWanted fullName,'>'.
allChangedClasses do: [ :eachClass |
Transcript cr ; show: 'Class <',eachClass name,'> in <',eachApplication name,'> changed by <',emUserWanted fullName,'>'.
].
]
].
]