Class: Deface::HamlConverter
- Inherits:
-
Haml::Engine
- Object
- Haml::Engine
- Deface::HamlConverter
- Defined in:
- lib/deface/haml_converter.rb
Instance Method Summary collapse
- #parse_new_attributes(line) ⇒ Object
- #parse_old_attributes(line) ⇒ Object
- #push_script(text, preserve_script, in_tag = false, preserve_tag = false, escape_html = false, nuke_inner_whitespace = false) ⇒ Object
- #push_silent(text, can_suppress = false) ⇒ Object
- #result ⇒ Object
Instance Method Details
#parse_new_attributes(line) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/deface/haml_converter.rb', line 30 def parse_new_attributes(line) attributes, rest, last_line = super(line) attributes[1] = deface_attributes(attributes[1]) return attributes, rest, last_line end |
#parse_old_attributes(line) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/deface/haml_converter.rb', line 21 def parse_old_attributes(line) attributes_hash, rest, last_line = super(line) attributes_hash = deface_attributes(attributes_hash) return attributes_hash, rest, last_line end |
#push_script(text, preserve_script, in_tag = false, preserve_tag = false, escape_html = false, nuke_inner_whitespace = false) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/deface/haml_converter.rb', line 7 def push_script(text, preserve_script, in_tag = false, preserve_tag = false, escape_html = false, nuke_inner_whitespace = false) push_text "<%= #{text.strip} %>" if block_given? yield push_silent('end') end end |
#push_silent(text, can_suppress = false) ⇒ Object
17 18 19 |
# File 'lib/deface/haml_converter.rb', line 17 def push_silent(text, can_suppress = false) push_text "<% #{text.strip} %>" end |
#result ⇒ Object
3 4 5 |
# File 'lib/deface/haml_converter.rb', line 3 def result Deface::Parser.undo_erb_markup! String.new(render) end |