wagn/wagn — pull request #190 by ethn (2014-06-29 05:18:52+00:00)
Title: Superformat

This is a significant refactoring of view handling to make formats/views work much more like cards/events.

Until now the primary mechanism for handling sets in formats has been special method naming for views. Now views (and other format methods) are handling by module inclusion at initialization time.

The main difference is that there are multiple format classes involved, so there are potentially multiple format modules per set. For example, for Pointer+*type, you would have just the one "set module"

Card::Set::Type::Pointer

..but you could have many "set format modules":

Card::Set::Type::Pointer::Format
Card::Set::Type::Pointer::HtmlFormat
Card::Set::Type::Pointer::CssFormat
...

and those would need to get included in the right contexts (as they now do).

This pull request is NOT yet ready for merging. There are still a few specs failing (7 I think), mostly because I haven't yet worked out a good mechanism for sharing view handling among different sets. Eg many things in the file set formats need to be used in image set formats, cards with the type Set inherit functionality from cards with the type Search, etc.