During a call to klass.maglev_persistable(true), we now copy included modules in the persistent namespace and copy class methods into their respective persistent method dictionary as well.
Furthermore, it adds the maglev_persistence tests to the .travis.yml: they missed before.
Is this a good idea?
Added test for maglev_persistable(true) persisting modules.
Execute persistence tests on travis.
Persisting modules when calling maglev_persistable(true).
Changed recursion stop condition.
Class methods are persisted as well.
Forgot to include the test in the test file. Done now.
added new persistence test
persisting extended methods, if maglev_persistable(true) called
copying ruby singleton class from transient to persistent dict. NOT R…
Test now checks for extending more than module.
Recursively persisting all extended modules.
I'm still thinking about whether this needs to be more flexible. Like, is it a use case that I want to persist the methods defined on a class, but not the inherited methods? Or maybe I want to persist only methods that are in the direct inheritance chain, but not the ones in included modules? I think we should at least add something to the persistence documentation about this. Maybe @srbaker or @snarfmason also have some opinions on that.
We discussed this a fair bit with Peter MacLain while we were in the Portland office in February. This one's pretty tricky, I'm not really sure what the right answer is.
I'm inclined towards flexibility, but the question I think really needs an answer is: What happens when we change a method definition? I have a class C that inherits from parent class P and includes module M. I have a bunch of instances of C in the persistent root. What happens if I want to add a method to C,P or M? What happens if I change one? And I think most difficult, what happens if I delete one?
I'm thinking uses cases like "don't persist inherited or included methods" might be useful for answering those question. But I'm not totally sure.
added a persistence test: class methods of a module are not persisted…
… with maglev_persistable(true)
fix for persistence test 19
Merge branch 'dikors/issue292' into stefan/maglev_persistable-persist…
_setPersistable: Checking namespace for nil before calling persistent…
…Copy. Required for anonymous modules.
persist methods only if the class or module was not persistable
Tagged one persistence test as failing.
Added a test for maglev_persistable(true) persisting constants.
Persisting constants in maglev_persistable(true).