2009/3/10 Matt Aimonetti <[email protected]>: > This is a very sensitive part of the critical path and I'd prefer to add > with care. Yehuda and I talked about it and we are worried that your patch > could end up with an infinite loop or classes loading twice. > > I'm not entirely sure what to say apart raising a concern.
Thanks for the reply Matt I've just posted up a couple of gists to illustrate the problem I've been having: What's happening loading my app with the current implementation of the bootloader: http://gist.github.com/77117 What's happening loading my app with the patched version of the bootloader: http://gist.github.com/77118 If you look at the first lot of 'KLASS TO BE LOADED:' lines in the output I get from the current implementation... load_classes_with_requirements is being asked to load the following files: mobile_phone_number.rb membership_application.rb home_postal_address.rb home_phone_number.rb boat_storage_payment_form.rb admin_entered_renewal.rb admin_entered_new_membership.rb admin_entered_boat_storage_payment_form.rb a_renewal.rb a_online_application.rb but because it's deleting from klasses as it iterates over them it's actually only loading the following the first time round: mobile_phone_number.rb home_postal_address.rb boat_storage_payment_form.rb admin_entered_new_membership.rb a_renewal.rb i.e. it is loading every other file rather than each in turn. If this is the intended behavior I'd really appreciate some help in understanding why. After it's finished the 'klasses.each do |klass|' loop, klasses still contains some files that the loop hasn't even attempted to load and failed_klasses cannot contain a definitive list of all the failed classes as the loop hasn't tried to load them all. At the end of the gist I show how this has ended up meaning that AdminEnteredNewMembership hasn't inherited the properties from MembershipApplication. Perhaps this has also (or actually only) highlighted a problem with Datamapper - I don't know as I can't quite get my head round why loading in the bizarre order that the unpatched code does results in this behavior. But from the merb pov some help in understanding the load every other file behavior in bootloader would be much appreciated. Thanks Rupert --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/merb?hl=en -~----------~----~----~----~------~----~------~--~---
