-
-
Save iMagesh/9ae481a75425234f1f0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'haml' | |
class ErbEngine < Haml::Engine | |
def push_script(text, preserve_script, in_tag = false, preserve_tag = false, | |
escape_html = false, nuke_inner_whitespace = false) | |
push_text "<%= #{text.strip} %>" | |
end | |
def push_silent(text, can_suppress = false) | |
push_text "<% #{text.strip} %>" | |
end | |
end | |
def haml_to_erb(haml) | |
ErbEngine.new(haml, :attr_wrapper => '"').render | |
end | |
# puts haml_to_erb(File.read('app/views/features/_feature.html.haml')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment