Module: Erubis::NoCodeEnhancer
- Included in:
- NoCodeEruby
- Defined in:
- lib/erubis/enhancer.rb
Overview
remove code and leave text, especially useful when validating HTML tags.
ex.
$ erubis -s -E NoCode file.eruby | tidy -errors
this is language independent.
Class Method Summary collapse
-
.desc ⇒ Object
:nodoc:.
Instance Method Summary collapse
- #add_expr(src, code, indicator) ⇒ Object
- #add_postamble(src) ⇒ Object
- #add_preamble(src) ⇒ Object
- #add_stmt(src, code) ⇒ Object
- #add_text(src, text) ⇒ Object
Class Method Details
.desc ⇒ Object
:nodoc:
304 305 306 |
# File 'lib/erubis/enhancer.rb', line 304 def self.desc # :nodoc: "remove code and leave text (useful when validating HTML)" end |
Instance Method Details
#add_expr(src, code, indicator) ⇒ Object
318 319 320 |
# File 'lib/erubis/enhancer.rb', line 318 def add_expr(src, code, indicator) src << "\n" * code.count("\n") end |
#add_postamble(src) ⇒ Object
311 312 |
# File 'lib/erubis/enhancer.rb', line 311 def add_postamble(src) end |
#add_preamble(src) ⇒ Object
308 309 |
# File 'lib/erubis/enhancer.rb', line 308 def add_preamble(src) end |
#add_stmt(src, code) ⇒ Object
322 323 324 |
# File 'lib/erubis/enhancer.rb', line 322 def add_stmt(src, code) src << "\n" * code.count("\n") end |
#add_text(src, text) ⇒ Object
314 315 316 |
# File 'lib/erubis/enhancer.rb', line 314 def add_text(src, text) src << text end |