Excellent! That is exactly the spirit we should promote for developing in Pharo. I think this is an area where Moose can contribute greatly. We really have a shot at setting a new standard for how code should be developed.
I will publish a longer blog post on the issue, but in the meantime, here is a quick reply. Actually, you do not need to load the whole project into a FAMIX model. You can do it simpler now directly with the Pharo objects.
Inspect this:
(RPackageOrganizer default packageNamed: 'Graph-ET')
allMethodReferences select: [ :each |
each method literalStrings anySatisfy: [ :literal |
literal notNil and: [literal beginsWith: 'RO' ] ] ]
You get a simple list of RGMethodDefinitions that you can go through like you would do in a to do.
The cool thing is that you can preview the source code in the inspector, and you can even modify the code right there. Essentially, you get a highly focused code browser (see attached).
Of course, you can also create a visualization, if you want.
| view |
view := ROMondrianViewBuilder new.
view
nodes: (RPackageOrganizer default packageNamed: 'Graph-ET') classes
forEach: [:cls |
view shape rectangle
if: [ :m |
m method literalStrings anySatisfy: [ :literal |
literal notNil and: [literal beginsWith: 'RO' ]] ]
fillColor: Color red.
view nodes: ((cls methods select: [:m | m package name beginsWith: 'Graph-ET']) collect: #asRingDefinition).
view gridLayout ].
view edgesFrom: #superclass.
view narrowTreeLayout.
view
If you inspect the view and click on a method, guess what :)
There are things to improve here. One thing I would want is for the list of items to update when I am accepting the code. Another thing is that we should make Ring more concise.
Nevertheless, it is already exciting. Don't you think so?
Cheers,
Doru