Issue #7608 has been reported by wonderingtomato (Tom Pave). ---------------------------------------- Bug #7608: Documentation, Std-lib, ERB https://bugs.ruby-lang.org/issues/7608 Author: wonderingtomato (Tom Pave) Status: Open Priority: Low Assignee: Category: DOC Target version: Next Major ruby -v: MRI 1.9.3-p327 =begin I believe the documentation for the ((<ERB::new|URL:http://ruby-doc.org/stdlib-1.9.3/libdoc/erb/rdoc/E...)) method could be improved. Specifically, the list of available arguments for the (({trim_mode})) paramenter doesn't seem complete. I found you can use the option (({"-"})) to make the tags (({<% -%>})) work. (by the way... It looks like those tags aren't documented either). Without that option the (({<% -%>})) tags don't work properly. I made several tests and can confirm the issue affects both Ruby 1.8.7 and 1.9.3. I've attached a short file (70 lines including whitespace) to reproduce the problem. Comments indicate what goes wrong, and I have provided a commented out line that works instead (as it uses the undocumented (({trim_mode="-"})) option). I came across the issue while working on a plain ruby script, but I used the same code in a Rails app with no problems at all, so I guess that ERB text is parsed in Rails with (({trim_mode="-"})) by default. =end
on 2012-12-23 05:40
on 2012-12-23 05:53
Issue #7608 has been updated by zzak (Zachary Scott). Subject changed from Documentation, Std-lib, ERB to Document ERB::new trim_mode parameter Assignee set to zzak (Zachary Scott) Target version changed from Next Major to 2.0.0 ---------------------------------------- Bug #7608: Document ERB::new trim_mode parameter https://bugs.ruby-lang.org/issues/7608#change-35018 Author: wonderingtomato (Tom Pave) Status: Open Priority: Low Assignee: zzak (Zachary Scott) Category: DOC Target version: 2.0.0 ruby -v: MRI 1.9.3-p327 =begin I believe the documentation for the ((<ERB::new|URL:http://ruby-doc.org/stdlib-1.9.3/libdoc/erb/rdoc/E...)) method could be improved. Specifically, the list of available arguments for the (({trim_mode})) paramenter doesn't seem complete. I found you can use the option (({"-"})) to make the tags (({<% -%>})) work. (by the way... It looks like those tags aren't documented either). Without that option the (({<% -%>})) tags don't work properly. I made several tests and can confirm the issue affects both Ruby 1.8.7 and 1.9.3. I've attached a short file (70 lines including whitespace) to reproduce the problem. Comments indicate what goes wrong, and I have provided a commented out line that works instead (as it uses the undocumented (({trim_mode="-"})) option). I came across the issue while working on a plain ruby script, but I used the same code in a Rails app with no problems at all, so I guess that ERB text is parsed in Rails with (({trim_mode="-"})) by default. =end
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.