pivotal/erector — pull request #38 by zelig (2012-11-17 18:58:57+00:00)
Title: global config and template handler allowing custom view paths

I implemented some new features i've been longing for :)

- rails template handler
- widget resolvers to allow custom vew_paths with registered widget class prefix
- widget resolvers to allow fallback to custom action (widget) libraries
- template handler checks if template defines the right class
- global setting for default class prefix, so everything works out of the box
- rewritten render specs

```
# given render 'prefix/name' this resolver will correctly find '/path/to/widgets/prefix/name.html.rb'
# and the template handler expects it to define class 'virtual/class_prefix/prefix/name'
ActiveSupport.on_load(:action_controller) do
append_view_path(WidgetLibraryResolver.new('virtual_class_prefix', '/path/to/widgets'))
end

# given render 'prefix/name' this resolver allows fall back '/path/to/widgets/name.html.rb'
# and the template handler expects it to define class 'virtual/class_prefix/name'
ActiveSupport.on_load(:action_controller) do
append_view_path(ActionWidgetLibraryResolver.new('virtual_class_prefix', '/path/to/widgets'))
end
```

- global settings:
- global settings extracted, implemented the usual way with mattr_accessors on the Erector module
- core and rails-specific configs are separated in erector/config and erector/rails/config respctively, config tests are separated too
- set defaults and overrides implemented and tested where used (e.g., output, output_spec)
- erector script also reads config
- AbstractWidget.prettyprint_default deprecated
- added rails3 initializer config generator with tests

```
Erector.setup do |config|

# erector configuration - global settings
# uncomment to change the defaults

#config.ignore_extra_controller_assigns = true
#config.controller_assigns_propagate_to_partials = true
#config.widget_class_name = 'Erector::Widget'
#config.content_method = :content
#config.prettyprint = false
#config.indentation = 0
#config.max_length = nil
#config.add_accessors_for_needs = false
#config.widget_class_prefix = "views"
end
```
- full test coverage and some doc change