[Nitro] OG [PATCH RFC]: Separate Og.start options hash from Og.manager_options

Mark Van De Vyver mvyver at gmail.com
Thu Sep 13 01:43:39 EDT 2007


Hi Devs,

Spec's helped indicate something was wrong but it still took much time
to work out what - esp given I was working on an adapter spec and this
is in the og.rb file.... :)

Separate Og start options hash from Og.manager_options - consecutive
starts no longer pollute Og.manager_options

The attached patch attempts to isolate the options hash that og
receives on start, and any changes made to it, from the defaults
stored in Og.manager_options.

Reason, consider the following sequence (pre-patch):

Og.start # Starts with Og default options - EXPECTED
Og.manager.close_store
Og.manager.unmanage_classes

Og.start({<custom_hash>}) # Starts with custom options - EXPECTED
Og.manager.close_store
Og.manager.unmanage_classes

Og.start # Starts with custom options - UNEXPECTED
Og.manager.close_store
Og.manager.unmanage_classes

Instead I believe the startup behavior should be (post-patch):

Og.start # Starts with Og default options - EXPECTED
Og.manager.close_store
Og.manager.unmanage_classes

Og.start({<custom_hash>}) # Starts with custom options - EXPECTED
Og.manager.close_store
Og.manager.unmanage_classes

Og.start # Starts with Og default options - EXPECTED
Og.manager.close_store
Og.manager.unmanage_classes

The way to change default startup behavior would be (post-patch):

Og.manger_options={}.update({<custom_hash>})
Og.start #starts with custom options - EXPECTED
Og.manager.close_store
Og.manager.unmanage_classes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mvdv-20070913-1.patch
Type: text/x-patch
Size: 64546 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070913/3ddd0972/attachment-0001.bin 


More information about the Nitro-general mailing list