default_formats array is used by LookupContext in order to allow rendering templates when :formats option is not passed. Previously it was always set to Mime::SET, which created dependency on Action Pack. In order to remove this dependency, Mime::SET is used only if ActionController is loaded.
Action View should not be responsible for translating mime types. Any formats that are passed to Action View classes should be in form of symbols, like :xml or :json. Any translation that's needed should be handled at controller level.
Automatically handling mime types for things other than :rss and :atom is not functionality that justifies dependency on Mime::Type from actionpack.
I've talked to José Valim, who added this comment, and there is no need to remove old API. It's good to have a simple way to instantiate ActionView::Base, by just passing view paths as a first argument, instead of constructing LookupContext and then the Renderer. [ci skip]
We can use another way to instantiate ActionView::Base, by passing renderer as a first option. Thanks to that we can just pass prefixes to LookupContext instead stubbing them on the controller. This is also good, because that kind of API is used in Rails code.
This needs to be insterted here to make code added in 60b4290 work. It's not added here due to extraction of actionview into separate gem.
This is another step in moving Action View's dependencies in Action Pack to Action View itself. Also, HtmlScanner seems to be better suited for views rather than controllers.
Since it's more about DOM classes and ids it belongs to Action View better. What's more, it's more convenient to make it part of Action View to follow the rule that Action Pack can depend on Action View, but not the other way round.
Since Action View should not depend on actionpack, it's best to delegate invalid_asset_host! to controller and just rely on such simple contract instead of raising this exception directly.
I ensured that all the tests in actionpack still pass, but tests in actionview fail. The reason for leaving them that way is that I don't want to move files *and* change them at the same time as it will be much harder to track changes that way using git log.
Fix for a test failing after: 00ff0a6
because Oracle Adapter does not support foreign keys if :polymorphic => true is used.