[ruby-core:72647] [Ruby trunk - Feature #11936] [Open] Allow ERB subclass to add token easily

From: takashikkbn@...
Date: 2016-01-01 06:42:29 UTC
List: ruby-core #72647
Issue #11936 has been reported by Takashi Kokubun.

----------------------------------------
Feature #11936: Allow ERB subclass to add token easily
https://bugs.ruby-lang.org/issues/11936

* Author: Takashi Kokubun
* Status: Open
* Priority: Normal
* Assignee: Masatoshi Seki
----------------------------------------
While I want to use ERB in Rails, escape token "<%==" is not available in ERB and we can't add a new token to ERB easily.
To allow ERB subclass to add a new token easily, I splitted ERB::Compiler#compile to some small methods and created ERB::Compiler::Scanner#stags and ERB::Compiler::Scanner#etags.

With this patch, we'll be able to add a new stag or etag by overriding these methods.
sample.rb is a sample to create ERB subclass with "<%==" token.

---Files--------------------------------
0001-Allow-ERB-subclass-to-add-token-easily.patch (8.4 KB)
sample.rb (882 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next