This step is a preparation to extend the functionality of the renderer.
To make the main class easier, the search for templates and building of
the tree is extracted into its own class.
The class_options gem is undergoing changes and for the time being the
git repo should be used.
Also the metrics are disabled because of a bug in the zentest gem.
This makes the assignment for bodies easier when using plain Strings.
They get wrapped in an array as per rack definition.
For every other type, they have to implement each and get directly set
as body or have to be rendered to Strings first.
Fix tests for PATCH, because spec_helper didn't support it and the tests where
wrong.
Remove if statement from "conent_type", because ruby already returns nil, if the
requested key in a hash is not found. (Sounds a bit ugly, but it's true.)
Killed 13 of 14 mutants. I will see later, how it's possible to kill the last
one.
I also fixed the return value of "preferred", if the in initialize given string
is empty. Fixed the default value here.
To make the router more loose, I replaced the router with the plain
environment. The custom parameters are stored in the same key, so can be
used by the request later.
Plus some specs.
This should it make later possible to make Zero work with Ruby 1.8. But
at the moment it only routes to the original decode_www_form method, if
it exists. Otherwise it returns an empty Array. So this will still fail
on the 1.8 versions at the moment.
The splitting of rendering and processing is good, but on the other side
it makes some double steps or even introduce workarounds.
That is why I made the method #render just a call to the renderer. This
should help much more than the strict seperation.
The method will only return the resulting string and not add it to the
body of the response. That still has to be taken care of by the user.