Class: GettextI18nRails::HamlParser
Class Method Summary
collapse
Methods inherited from BaseParser
load_library, parse, target?
Class Method Details
.convert_to_code(text) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/gettext_i18n_rails/haml_parser.rb', line 9
def self.convert_to_code(text)
case @library_loaded
when "haml"
if Haml::VERSION.split('.').first.to_i <= 5
Haml::Engine.new(text).precompiled()
else
Haml::Engine.new.call(text)
end
when "hamlit"
Hamlit::Engine.new.call(text)
end
end
|
.extension ⇒ Object
5
6
7
|
# File 'lib/gettext_i18n_rails/haml_parser.rb', line 5
def self.extension
"haml"
end
|
.libraries ⇒ Object
22
23
24
|
# File 'lib/gettext_i18n_rails/haml_parser.rb', line 22
def self.libraries
["haml", "hamlit"]
end
|