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

Instance Method Summary collapse

Class Method Details

.descObject

: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