Sha256: 1b0f9c4d0ecf1f3abe29e09658c358b1021a97dd077d62fd1941b60f43c55784
Contents?: true
Size: 635 Bytes
Versions: 6
Compression:
Stored size: 635 Bytes
Contents
# ERB templating. #-- # Copyright 2006 Suraj N. Kurapati # See the file named LICENSE for details. require 'erb' # A version of ERB whose embedding tags behave like those # of PHP. That is, only <%= ... %> tags produce output, # whereas <% ... %> tags do *not* produce any output. class ERB alias original_initialize initialize def initialize aInput, *aArgs # ensure that only <%= ... %> tags generate output input = aInput.gsub %r{<%=.*?%>}m do |s| if ($' =~ /\r?\n/) == 0 s << $& else s end end aArgs[1] = '>' original_initialize input, *aArgs end end
Version data entries
6 entries across 6 versions & 1 rubygems