Sha256: 5ba3ce4cf00722684d4658e1b06aacd78dc9ddd516773b3e2bcdb24292e33a91

Contents?: true

Size: 709 Bytes

Versions: 9

Compression:

Stored size: 709 Bytes

Contents

module JettyRails
  module Handler
    class PublicDirectoryHandler < JettyRails::Handler::DelegateOnErrorsHandler
  
      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
  
      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
      
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
mikewadhera-jetty-rails-0.9.1 lib/jetty_rails/handler/public_directory_handler.rb
mikewadhera-jetty-rails-0.9.2 lib/jetty_rails/handler/public_directory_handler.rb
mikewadhera-jetty-rails-0.9.3 lib/jetty_rails/handler/public_directory_handler.rb
mikewadhera-jetty-rails-0.9 lib/jetty_rails/handler/public_directory_handler.rb
nolman-jetty-rails-0.9.6-jruby lib/jetty_rails/handler/public_directory_handler.rb
jetty-rails-0.8.1 lib/jetty_rails/handler/public_directory_handler.rb
jetty-rails-0.6 lib/jetty_rails/handler/public_directory_handler.rb
jetty-rails-0.8 lib/jetty_rails/handler/public_directory_handler.rb
jetty-rails-0.7 lib/jetty_rails/handler/public_directory_handler.rb