Class: Haml::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/merb_global/parsers/haml_parser.rb

Instance Method Summary collapse

Instance Method Details

#parse_tag(line) ⇒ Object

Overriden function that parses Haml tags Injects gettext call for plain text action.



11
12
13
14
15
16
17
# File 'lib/merb_global/parsers/haml_parser.rb', line 11

def parse_tag(line)
  tag_name, attributes, attributes_hash, object_ref, nuke_outer_whitespace,
    nuke_inner_whitespace, action, value = super(line)
  @precompiled << "_(\"#{value}\")\n" unless action || value.empty?
  [tag_name, attributes, attributes_hash, object_ref, nuke_outer_whitespace,
      nuke_inner_whitespace, action, value]
end

#push_plain(text) ⇒ Object

Overriden function that producted Haml plain text Injects gettext call for plain text action.



20
21
22
# File 'lib/merb_global/parsers/haml_parser.rb', line 20

def push_plain(text)
  @precompiled << "_(\"#{text.strip}\")\n"
end