I discovered MooseMonticelloImporter…. :)
and some methods cannot compile :)
I would merge MooseMonticelloPopulator and MooseMonticelloVisitor (because this is about
only 3 stupid accessors).
scope is undeclared. :(
sad it means that there are not tests :(
There is a test called MooseMonticelloImporterTest.
The test is not extensive, this is a pity, but writing tests for Monticello or Metacello
is difficult and extremely time consuming.
I spent some times now on improving the code and the tests.
'scope' is indeed undeclared, but it was unnecessary. I cleaned the class a bit.
Moose-MonticelloImporter-AlexandreBergel.25
Moose-Tests-MonticelloImporter-AlexandreBergel.3
are in da box!
Cheers,
Alexandre
importFileNamed: name
| version definitions visitor progressBar step |
self setMooseModel.
[ version := self repository versionFromFileNamed: name. ]
on: Error
do: [:ex | self inform: 'Package ', name, ' not accessible from the file
system?'. ^ self targetModel].
definitions := version snapshot definitions.
MooseCustomTask runWithProgress: [:bar |
visitor := MooseMonticelloClassPopulator new importer: self.
definitions do: [ :def | def accept: visitor.
bar increment].
] description: 'Importing classes' length: (definitions size).
self setSuperclassesAndCreateStubs.
"create a scope, this is necessary for the method visitor which is VW aware"
scope := Dictionary new.
self targetModel allClasses do: [:famixClass |
famixClass attributes do: [:famixAttribute |
(self scopeOfClass: famixClass) at: famixAttribute name bind: famixAttribute]].
MooseCustomTask runWithProgress: [:bar |
"import methods"
definitions do: [ :def |
(def isKindOf: MCMethodDefinition)
ifTrue: [
visitor := MooseMonticelloMethodPopulator new importer: self.
def accept: visitor.
self targetModel addAll: visitor entities]].
bar increment.
] description: 'Importing methods' length: (definitions size).
^ self targetModel
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.