Sha256: 15443248663e10a3647aca22b028d41f7178b604999968f74e01727274ab1d58

Contents?: true

Size: 759 Bytes

Versions: 15

Compression:

Stored size: 759 Bytes

Contents

#
# Setup Slim
require 'slim'
::Slim::Engine.set_options pretty: true

require 'tilt'

module RevealCK
  module Templates
    # Public: A Processor is given a template and expected to render
    # it.
    class Processor
      include Retrieve

      attr_reader :config

      def initialize(args)
        @config = retrieve(:config, args)
        file = retrieve(:file, args)
        @template = Tilt.new file
      end

      def output(locals = {})
        scope = RevealCK::Render::Scope.new(dir: Dir.pwd, config: config)
        @template.render scope, locals
      end

      def self.open(args)
        file = retrieve(:file, args)
        config = retrieve(:config, args)
        Processor.new(file: file, config: config)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
reveal-ck-4.0.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.9.2 lib/reveal-ck/templates/processor.rb
reveal-ck-3.9.1 lib/reveal-ck/templates/processor.rb
reveal-ck-3.9.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.8.1 lib/reveal-ck/templates/processor.rb
reveal-ck-3.8.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.7.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.6.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.5.1 lib/reveal-ck/templates/processor.rb
reveal-ck-3.5.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.4.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.3.1 lib/reveal-ck/templates/processor.rb
reveal-ck-3.3.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.2.0 lib/reveal-ck/templates/processor.rb
reveal-ck-3.1.0 lib/reveal-ck/templates/processor.rb