Class: WPRoot::Haml

Inherits:
Object
  • Object
show all
Defined in:
lib/wproot/haml.rb

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Haml

Returns a new instance of Haml.



3
4
5
# File 'lib/wproot/haml.rb', line 3

def initialize(content)
  @content = content
end

Instance Method Details

#compileObject



7
8
9
10
11
12
13
# File 'lib/wproot/haml.rb', line 7

def compile
  IO.popen(['php', File.expand_path('../../../vendor/HamlPHP.php', __FILE__)], 'w+') do |io|
    io.write(@content)
    io.close_write
    io.read
  end
end