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:



303
304
305
# File 'lib/erubis/enhancer.rb', line 303

def self.desc   # :nodoc:
  "remove code and leave text (useful when validating HTML)"
end

Instance Method Details

#add_expr(src, code, indicator) ⇒ Object



317
318
319
# File 'lib/erubis/enhancer.rb', line 317

def add_expr(src, code, indicator)
  src << "\n" * code.count("\n")
end

#add_postamble(src) ⇒ Object



310
311
# File 'lib/erubis/enhancer.rb', line 310

def add_postamble(src)
end

#add_preamble(src) ⇒ Object



307
308
# File 'lib/erubis/enhancer.rb', line 307

def add_preamble(src)
end

#add_stmt(src, code) ⇒ Object



321
322
323
# File 'lib/erubis/enhancer.rb', line 321

def add_stmt(src, code)
  src << "\n" * code.count("\n")
end

#add_text(src, text) ⇒ Object



313
314
315
# File 'lib/erubis/enhancer.rb', line 313

def add_text(src, text)
  src << text
end