Sha256: 5034f7094cec0598b9c96171cd08c964a2d206e55f27f07c7c5a4e93d1d7b6a3

Contents?: true

Size: 454 Bytes

Versions: 1

Compression:

Stored size: 454 Bytes

Contents

require 'opal'
require 'opal/haml/processor'
require 'opal/haml/version'

module Opal
  module Haml
    def self.compile(source, file = '(haml)')
      haml = ::Haml::Engine.new(source, :ugly => true).precompiled
      Opal.compile(wrap(haml, file))
    end

    def self.wrap(haml, file)
      "Template.new('#{file}') do |_hamlout|\n#{haml}\n_hamlout.join\nend\n"
    end
  end
end

Opal.append_path File.expand_path('../../../opal', __FILE__).untaint

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-haml-0.2.0 lib/opal/haml.rb