(Just realized I forgot to include the patch for
#controller_assigns_propagate_to_partials in my last message. It's
here:
http://github.com/ageweke/erector/commit/3bd7580ebb9ad0420146839d32c83715b97b0ad6
)
A list of commits I've added to my Erector fork on github; I'd like to
offer these for upstream integration. All are viewable at
http://github.com/ageweke/erector
. These are just things I found when working on converting chunks of
our existing ERb codebase to Erector. I don't think any should be
hugely controversial; here's a list and summary:
'erector' tool
--------------
0fe6b31dd2028e26557d116d686bed48f55c52f4,
87451b55e07892581b9f281609db630835afcdd9,
8ede63ab56737d360fe3cec9cd0eb9dc91440e34 -- '<div id="foo_<%= bar
%>_baz">' was getting transformed into "div :id => 'foo_<%= bar
%>_baz'". Now it turns into "div :id => ('foo_' + bar + '_baz')".
b9a001e68e2c5e15ce00cd5c3fb77e108a63d8bc -- given the above, "<form
action="<%= url_for :action => 'baz' %>">" was getting transformed
into "form :action => (url_for :action => 'baz') do", which blows up
the parser. Now it adds parentheses -- "form(:action =>
(url_for :action => ...", which makes it work.
7749fd5dfda93047bc46e89e8cf0653ebdce7562 &
8ede63ab56737d360fe3cec9cd0eb9dc91440e34 -- '<% if foo -%>' was
getting transformed into 'if foo -', which obviously blows up the
parser. It now turns into simply 'if foo'.
5676b001bb7a6de21eb68fad89e4bc9d0bdbf020 -- Add a command-line option
to set a different superclass for the new widget, other than
'Erector::Widget'. Useful if you have your own custom superclass you
want all widgets to use.
2c100ff187fe686855a26bdd49d72fc53185a323 -- Add a command-line option
to set a different method name to be overridden on your new widget
(other than 'content'). Useful if you have your own custom superclass
you want all widgets to use.
Rails support
-------------
89fea9048f1606f43c4f0a0e9620e6a0f88e85fa -- Adds support for 'url_for'
and 'image_path' to RailsWidget; factors out the directly-delegated
methods into an array, to make this cleaner.
docs
----
5126f2486de8de42da0dffaf9b22864c0ad0bc06 -- Erector::Widget rdoc still
claimed that 'needs' created attr_readers. Fixed the rdoc.