Class JettyRails::Handler::PublicDirectoryHandler
In: lib/jetty_rails/handler/public_directory_handler.rb
Parent: JettyRails::Handler::DelegateOnErrorsHandler

Methods

Public Class methods

[Source]

# File lib/jetty_rails/handler/public_directory_handler.rb, line 6
      def initialize(config)
        super()
        @config = config
        @resources = Jetty::Handler::ResourceHandler.new
        @resources.resource_base = @config[:base] + '/public'
        context_capable = add_context_capability_to @resources
        self.handler = context_capable
      end

Public Instance methods

[Source]

# File lib/jetty_rails/handler/public_directory_handler.rb, line 15
      def add_context_capability_to(handler)
        return handler if @config[:context_path].root?
        context_handler = Jetty::Handler::ContextHandler.new(@config[:context_path])
        context_handler.handler = handler
        context_handler
      end

[Validate]