Sha256: 8019d0f700e07eb962af64a2d00963df7327171be5860c07c8b50dffd6aebee7

Contents?: true

Size: 510 Bytes

Versions: 8

Compression:

Stored size: 510 Bytes

Contents

begin require 'haml'; rescue LoadError; end 

module Tadpole
  module SectionProviders
    class HamlProvider < SectionProvider
      EXTENSIONS = ['.haml']
      
      def initialize(full_path, owner)
        super
        @haml = Haml::Engine.new(content)
      rescue NameError => e
        STDERR.puts "You're missing Haml! Install the gem with `gem install haml`."
        exit
      end
      
      def render(locals = {}, &block)
        @haml.render(owner, locals, &block)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tadpole-0.1.7 lib/tadpole/providers/haml.rb
tadpole-0.1.1 lib/tadpole/providers/haml.rb
tadpole-0.1.2 lib/tadpole/providers/haml.rb
tadpole-0.1.3 lib/tadpole/providers/haml.rb
tadpole-0.1.4 lib/tadpole/providers/haml.rb
tadpole-0.1.5 lib/tadpole/providers/haml.rb
tadpole-0.1.6 lib/tadpole/providers/haml.rb
tadpole-0.1.0 lib/tadpole/providers/haml.rb