Sha256: 8b1a15ffeb89b5d0e37b1d9a7fb921538f64b2baf8dd4086ffdbcf5f2716ac52

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

module Restfulie
  module Server
    module ActionView
      module TemplateHandlers #:nodoc:
        autoload :Tokamak, 'restfulie/server/action_view/template_handlers/tokamak'
        
        def self.template_registry
          if defined? ::ActionView::Template and 
            ::ActionView::Template.respond_to?(:register_template_handler)
              ::ActionView::Template
          else
            ::ActionView::Base
          end
        end
        
        # It is needed to explicitly call 'activate!' to install the Tokamak
        # template handler
        def self.activate!
          template_registry.register_template_handler(:tokamak, 
                Restfulie::Server::ActionView::TemplateHandlers::Tokamak)
      
          # TODO unsure if it can be removed. check feedback prior to 1.0.0
          # if defined?(::ActionController::Base) && ::ActionController::Base.respond_to?(:exempt_from_layout)
            # ::ActionController::Base.exempt_from_layout :tokamak 
          # end    
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
restfulie-1.0.0.beta1 lib/restfulie/server/action_view/template_handlers.rb
restfulie-0.1.0.beta1 lib/restfulie/server/action_view/template_handlers.rb
restfulie-0.9.3 lib/restfulie/server/action_view/template_handlers.rb