Sha256: 52f857c87b35e58fbe5fb8595494fa3e5ad6f6d4770b158b8842b193e913bbcb

Contents?: true

Size: 1.07 KB

Versions: 18

Compression:

Stored size: 1.07 KB

Contents

# ===========================================================================
# Project:   Abbot - SproutCore Build Tools
# Copyright: ©2009 Apple Inc.
#            portions copyright @2006-2009 Sprout Systems, Inc.
#            and contributors
# ===========================================================================

module SC
  module RenderEngine

    class Haml
      def initialize(html_context)
        @html_context = html_context
      end

      def compile(input)
        begin
          require 'haml'
        rescue
          raise "Cannot render HAML file because haml is not installed. Try running 'sudo gem install haml' and try again"
        end
        ::Haml::Engine.new(input).send(:precompiled_with_ambles, [])
      end

      def concat(string, binding)
        eval("_hamlout", binding).push_text string
      end

      def capture(*args, &block)
        if @html_context.respond_to?(:is_haml?) && @html_context.is_haml?
          @html_context.capture_haml(nil, &block)
        else
          block.call(*args).to_s
        end
      end
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
sproutcore-1.4.4-java lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.4 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.3.1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.3-java lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.3 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.2-java lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.2 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.1-java lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.0-java lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.0 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.0.rc.5 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.0.rc.4 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.0.rc.3 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.0.rc.2 lib/sproutcore/render_engines/haml.rb
sproutcore-1.4.0.rc lib/sproutcore/render_engines/haml.rb
sproutcore-1.0.1049.pre.2 lib/sproutcore/render_engines/haml.rb
sproutcore-1.0.1049.pre.1 lib/sproutcore/render_engines/haml.rb