Sha256: 4a774b87b338c4a55170e3b36a1914d56894d3b227a7820a5127ca041d41b3a4

Contents?: true

Size: 604 Bytes

Versions: 4

Compression:

Stored size: 604 Bytes

Contents

module ActionView
  class Template
    module Handlers
      class Tex
        def handles_encoding?; true; end

        class_attribute :default_format
        self.default_format = Mime[:pdf]

        def erb_handler
          @@erb_handler ||= ActionView::Template.registered_template_handler(:erb)
        end

        def self.call(template, source)
          new.call(template, source)
        end

        def call(template, source)
          compiled_source = erb_handler.call(template, source)

          "Latexpdf::compile(begin;#{compiled_source};end)"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
latexpdf-0.6.1 lib/action_view/template_handlers/tex.rb
latexpdf-0.6.0 lib/action_view/template_handlers/tex.rb
latexpdf-0.5.1 lib/action_view/template_handlers/tex.rb
latexpdf-0.5.0 lib/action_view/template_handlers/tex.rb