Class: N::CompressShader
Overview
Compress the inline xhtml. Does not touch the ruby code.
Instance Attribute Summary
Attributes inherited from Shader
Instance Method Summary collapse
-
#process(hash, text) ⇒ Object
Compress the inline xhtml.
Methods inherited from Shader
#<<, #initialize, #process_next
Constructor Details
This class inherits a constructor from N::Shader
Instance Method Details
#process(hash, text) ⇒ Object
Compress the inline xhtml. Does not touch the ruby code.
214 215 216 217 218 219 220 221 |
# File 'lib/nitro/shaders.rb', line 214 def process(hash, text) text.gsub!(/\@out \<\< \%\^(.*?)\^/m) do |match| c = $1.gsub(/^(\s*)/m, '').squeeze(" \t").tr("\n", '').tr("\t", ' ') "@out << %{#{c}}" end process_next(hash, text) end |