Sha256: 82717de09da67390ecfee75e5fa9515e936f8d187485edc0c3d294e0421cf0e3

Contents?: true

Size: 909 Bytes

Versions: 26

Compression:

Stored size: 909 Bytes

Contents

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

require 'haml'

module SC
  module RenderEngine

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

      def compile(input)
        ::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

26 entries across 26 versions & 1 rubygems

Version Path
sproutcore-1.11.0.rc3 lib/sproutcore/render_engines/haml.rb
sproutcore-1.11.0.rc2 lib/sproutcore/render_engines/haml.rb
sproutcore-1.11.0.rc1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.10.3.1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.10.2 lib/sproutcore/render_engines/haml.rb
sproutcore-1.10.1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.10.0 lib/sproutcore/render_engines/haml.rb
sproutcore-1.10.0.rc.3 lib/sproutcore/render_engines/haml.rb
sproutcore-1.10.0.rc.2 lib/sproutcore/render_engines/haml.rb
sproutcore-1.10.0.rc.1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.9.2 lib/sproutcore/render_engines/haml.rb
sproutcore-1.9.1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.9.0 lib/sproutcore/render_engines/haml.rb
sproutcore-1.8.2.1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.8.1 lib/sproutcore/render_engines/haml.rb
sproutcore-1.8.0 lib/sproutcore/render_engines/haml.rb
sproutcore-1.7.1.beta-java lib/sproutcore/render_engines/haml.rb
sproutcore-1.7.1.beta lib/sproutcore/render_engines/haml.rb
sproutcore-1.6.0.1-java lib/sproutcore/render_engines/haml.rb
sproutcore-1.6.0.1 lib/sproutcore/render_engines/haml.rb